Back to book

What is a behaviour?

What are Codebots behaviours and how do you use them?

In the words of our CEO, "behaviours are the cool stuff the bots can create".

Behaviours are patterns of functionality which are often repeated in different products. Codebots takes advantage of these repetitions and uses them as a chance to save development effort. The Platform and bots have reusable behaviours which can be applied to any part of a product. This allows security updates and other improvements to be propagated at scale.

Behaviours can be added to an application using both the Entity and UI Diagrams in the Build section of the Codebots platform.

Codebots behaviours come with a lot of functionality out-of-the-box, but can also be extended and customised by human developers. Some behaviours, such as Forms and Workflows, may also need to be configured at run-time using the administration section of your application.

Content reuse

To understand behaviours, you need to understand content reuse. Software developers aim to reuse code as much as possible. Consequently, behaviours reuse code on the Codebots Platform.

Imagine for a moment that you write your first program and you need to write everything yourself from scratch. Later on, when you want to write another program you might find you can reuse bits of your first program. You can copy and paste the code, rather than writing it again. That is fine, provided you can keep the new program as organised and neat as the first program. The more programs you write, the more code you can reuse, and the faster you can complete each project. Then again, if you change one of the copied segments, you need to remember to go back and update the original. Maintenance becomes very difficult, very quickly.

Behaviours allow you to reuse and share content. They are made from separate, modular blocks of code which represent one specific feature on a web application.

Behaviours categorise program behaviour into clear and recognisable shapes and functions keeping development neat. Some examples of recognisable behaviours include forms for user research, timelines for tracking events and actions, and API for integrating one platform with another. All of these are available to be included in a Codebots application (depending on the codebot used).

When we create a new piece of functionality, and if we think it will be useful to reuse, we teach a codebot how to recreate that functionality by writing the code in a reusable module, and then let the codebots access those modules.

Using behaviours for your own application

When you are planning out an application, it can be very helpful to understand how your own requirements match Codebots' behaviours so you can make the most of the bots. Whilst some of them come pre-activated for all projects (like the API behaviour), most are optional and need to be voluntarily activated in order to use them.

We have created a Behaviour Identification Guidelines to help you recognise where you could use a behaviour to assist with your work. Not only is this process useful to help gain some visibility into potential implementation plans, but it can help you calculate how much Codebots will able to help your team develop. Alternatively, the behaviours may give you ideas for new pieces of functionality which you may want to include (since it would be so easy to build them, why not?).

To best understand how to use and make the most of the behaviours, we are working on a series of qualifications for all the available behaviours. From Forms to Workflows, learn how to identify when it can be used, how to add it to your app, configure it to suit your needs, and how to customise it to take full advantage of its capabilities.