Enterprise-grade systems invariably have a business or domain logic layer that encodes - usually on the back-end - the real-world business rules that determine how data can be created, displayed, stored and changed.
Business logic can be simple, like writing into a single database table. It can also be very complex, such as writing into multiple tables simultaneously, while checking user permissions and calling multiple external systems for validation and additional data entry. For example, in a traditional or classic three-layer web application architecture, much of the business logic resides at the database level typically enclosed in stored procedures that can be difficult to maintain.
OutSystems Platform is designed to address such complexity and enable high productivity in the processes of creation and maintenance of complex logic in systems. A number of features and constructs simplify complex business logic coding:
Programmatic constructs: The fundamentals needed to create complex logic
Extensibility: The ability to use Java and .NET to bring in more functions and constructs
Data source manipulation: Simplification of database connection and exposing web services with visual data aggregation or writing plain SQL
Code reusability and modularity: Logic that can be reused anywhere
Asynchronous logic: Actions that periodically synchronize customer information or enable scheduling
Business process orchestration: Long running transactions that orchestrate human collaboration and back-end activities.
Visual point-and-click, debugging and monitoring: Why writing complex logic is better with OutSystems
Along with the visual point-and-click model for coding, OutSystems Platform has all the fundamental programmatic constructs to create complex logic: if statements, cycles, case switch, variables, arrays and complex data types. A complete expression language with formatting, conversion, mathematical, text manipulation functions and others provides the required flexibility to help compute any complex logic.
More programmatic functions and constructs can be easily be brought in using C# or Java; for example, hash tables and regular expressions.
Data source manipulation
Connecting to databases, or exposing and consuming SOAP web services or REST APIs is easy. With visual data aggregation, data retrieval is very simple. And, the ability to write plain SQL is always available .
Combined with programmatic constructs, data sets can be iterated in memory in several levels of nested loops, and can also be easily handled with typical list manipulation functions such as insert, append, and remove.
Code reusability and modularity
All logic written with OutSystems Platform can be reused anywhere inside an application or exposed to any application in the software factory. This capability allows the creation of comprehensive modules and APIs, which leads to a sound architecture and true modularity.
For example, a classic programming pattern such as recursion is easily implemented using OutSystems Platform.
There are situations where the complexity and time needed to complete certain processing routines is just too long to wait for after the click of a button. OutSystems Platform allows you to easily run any logic asynchronously. Here is an example of an action that periodically synchronizes customer information:
Additionally, you can configure the schedule of operations and monitor them:
Business process orchestration
Long-running transactions, commonly referred to as business processes, are another type of complex logic. Orchestrating a collaborative workflow with human activities or a back-end orchestration triggered by specific events is easy with OutSystems Platform.
From a single tool, development teams can automate the design, deployment, execution, feedback gathering, monitoring and optimization of both processes and applications, It can all be done without the burden of complex and costly integration—because when change happens, it happens both in the application and the process.
Here's a order fulfillment process and its approval sub-process:
Why is it better with OutSystems?
Writing complex logic with OutSystems Platform is actually better than using traditional coding languages because:
The visual nature of the point-and-click model makes knowledge transfer extremely easy, compared to going through thousands of lines of code.
Complex logic is...complex! A full-fledged visual debugger allows developers to dive into the visual code and understand how it is behaving, making troubleshooting a breeze.
The monitoring capabilities enable teams to troubleshoot performance bottlenecks but they also are available for audits. It is possible to configure different levels of verbosity to trace complex scenarios and complex message exchanges.