Backendless Support
 

Custom business logic

This is an introductory article for a very broad feature - injecting custom server-side logic into Backendless. 

There are a lot of smaller features in Custom Business Logic, but it's worth to start with a general overview. 

As a developer has noticed exploring the Backendless Knowledge Base, services includes  in Backendless execute specific and well-defined operation based on the received arguments. 

For example, the logic API request checks if the user credentials are valid and if they are, establishes a session. An API call to search for an object in a data table, finds the object and returns it back to the client. There are many scenarios when the built-in functionality either should be augmented to perform some additional logic or completely overridden. 

This is exactly what Custom Business Logic (CBL) does - it is a framework that lets you inject your own code into the Backendless API invocation chain.

CBL relies on the concept of event handlers, where an event is an API invocation request. 

For example, the Login API request is the Login event. For every event, there are two possible handlers: a "before" and "after" handler. These handlers is where your custom code can be injected. 

The following diagram demonstrates the API invocation chain:

The CBL code can is deployed to the Backendless cloud and thus entirely managed by Backendless. The service is responsible for making sure that the code is properly deployed and distributed to guarantee high availability and scalability. There are a lot of very cool features to simplify the process of building CBL and my future posts will be reviewing them in great detail. Until then to get you started, it is highly recommended to explore Backendless Custom Business Logic Quick Start guide.

Is article helpful?