CodeRunner™

Top  Previous  Next

Custom server code development, debugging and runtime execution in Backendless is made possible with a special component called CodeRunner™. It is available for download from the Backendless website and is also automatically included into the server-side code/projects generated using Backendless console. The CodeRunner SDK includes several command line tools enabling the process of debugging custom code and subsequently deploying it to Backendless. It is important to note that CodeRunner makes it possible to debug custom code entirely on the developer's computer while the code is "plugged into" the API workflow in the cloud. This means the custom code developer writes, whether it is an API service, API event handler or a timer, can be debugged using traditional approaches (line-by-line code step through, variable inspection,STDOUT logging) by triggering that code through the main Backendless Cloud service. See the Development and Debugging section for details.

 

The process of developing custom business logic with Backendless is slightly different between API services and event handlers/timers. The only difference is the latter may include the step of code-generation which simplifies the workflow.

API Event Handlers and Timers


Backendless supports two approaches for developing custom business logic:

1.Expressive, code-driven approach. With this approach a developer bypasses code generation and builds the custom code for event handlers and timers by using the published APIs.
2.Declarative, console-driven approach. This approach relies on a code generator built into Backendless Console. Using the code generator developer selects the API events and configures schedules for timers for which he intends to add custom logic. The system automatically generates the code which can be downloaded for further development.
 
The diagram below illustrates the process:
backendless-development-process
where:
1.Developer generates code for event handlers and configures timer schedules using Backendless Console. The console includes a code generator which creates the place holder Java code for the API events and timers. The code can be downloaded as a project archive which includes project files for IntelliJ IDEA and Eclipse IDEs. This step is optional, but it significantly simplifies the development process and saves development time.
2.Using an IDE developer writes custom business logic. The compiled code is passed to CodeRunner™, which is a command line utility used for local debugging of the custom business logic code. Developer can optionally attach to the CodeRunner™ process to set breakpoints in the code for step-by-step debugging.
3.CodeRunner™ registers with the Backendless Cloud Service. It instructs Backendless to route the API and timer events to the developer computer for the debugged code.
4.Client application sends an API request.  Backendless determines if there is an event handler registered for the received API request and routes the event information to CodeRunner™.
5.CodeRunner™ receives the request and executes the code. Developer can inspect and debug invocations locally before the custom code is deployed to the production environment.

API Services


The workflow of developing API services is illustrated in the diagram below:
service-dev-process
where:

1.Developer downloads and installs the Backendless CodeRunner SDK. Using an IDE developer writes the service code. The compiled code is passed to CodeRunner™, which is a command line utility used for local debugging. Developer can optionally attach to the CodeRunner™ process to set breakpoints in the code for step-by-step debugging.
2.CodeRunner™ registers with the Backendless Cloud Service. It instructs Backendless to route the service invocation requests to the developer computer for the debugged code.
3.Client application sends a service API request.  Backendless determines if there is a service registered for the received API request and routes it to CodeRunner™.
4.CodeRunner™ receives the request and executes the code. Developer can inspect and debug invocations locally before the custom code is deployed to the production environment.

Please let us know how we can improve the documentation by leaving a comment. All technical questions should be posted to the Backendless Support forum. We do not respond to the technical questions on the documentation pages.: