We have had a very successful beta release and received a lot of positive feedback. We would like to thank everyone for your contribution which helped us make the product better than ever.
As we are preparing for the GA release of 4.0, there are changes which may affect your apps. Please see the list below:
With the introduction of Deployment Models for business logic (Cloud Code), we also added support for “invocation chains”. This is an ability to chain together multiple server-side event handlers registered to process the same event. Previously, you could inject cloud code into the API invocation flow as shown in the image below:
For any API call, you could have only one before/after event handler with your own custom business logic. This is changing with deployment models and you can have multiple event handlers chained together:
This is a HUGE improvement. It promotes better design for cloud code with a clean division of responsibilities between the event handlers. It is important to note that any data received as arguments for an API call is passed from one event handler to another. If an event handler sitting at the beginning of the chain makes a change to an argument (or the return value), then all other event handlers down the chain will get the modified value.
A question you might be asking is how to configure the order of the event handlers. This is done in the Backendless Console. Consider the following example:
As you can see there are three "beforeCreate" event handlers for the "*" context (which means they apply to every data table). When Backendless detects you have more than one event handler applicable to a particular context, it displays the “handler ordering” icon:
Clicking the icon opens up a popup where you can control the execution order for all applicable event handlers:
We’ll have a video posted to our YouTube channel with a demo of the functionality soon. That’s all for now, guys. Happy coding!
We are preparing one of the final Beta builds for Backendless 4. The build should be released early in the week of June 19th. We plan to release the service out of beta shortly after that. One of the important changes in the upcoming service update will be the introduction of deployment models. When the service is updated with that build, it will be necessary to redeploy your business logic (API Services, Event Handlers, and Timers) using the latest release of CodeRunner. If you do not do that, any existing business logic in the Backendless 4 apps will stop working.
We realize it is going to cause an inconvenience – we really wanted to avoid it. However, the service is in beta and we thought you’d cut us some slack.
One of the new features we will be releasing in the final update of Backendless 4 beta is support for “business logic deployment models”. This is a new concept introduced in Backendless 4. A “deployment model” combines individual API event handlers, timers and API services into a single group. The purpose of that grouping will become more apparent once we start opening up Backendless Marketplace for submissions, however, the introduction of this feature already opens some very cool features.
This change will be available in the Backendless 4 applications the week of June 19th.
Some important things to keep in mind when working with deployment models:
Let’s take a look at how to work with the deployment models:
When creating an event handler or timer in the Backendless Console you will see a new drop-down list where you can select an existing model. To create a new one, simply type in the desired model and click the menu option to create it. The screenshot below is for creating a new event handler. You will see an identical change in the “New Timer” popup:
The Event Handlers screen in console displays the model name for every handler (see the MODEL column):
When you download the generated code for event handlers and timers, you need to choose the model for which to download the code. The downloaded code contains only the event handlers and the timers for the selected model:
Similarly, if you were to edit the code directly in the Backendless Console on the CODING screen, you need to choose the language and the model. The displayed tree of directories and files will contain only the code for the selected model:
For most use-cases, you will find it sufficient to work with the same model. We considered how developers use business logic now and tried to make the developer experience mostly unchanged.