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 by creating 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 dragged onto entities or pages 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 using protected regions. Some behaviours, such as Forms and Workflows, may also need to be configured at run-time using the administrator 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 code, rather than writing from scratch. That is fine, provided you can keep the new program as organised and neat (ideally) as the first program. The more programs you write, the more code you can reuse, and the faster you can complete each project.

Behaviours allow you to reuse content, and to share content. They are made from separate, modular blocks of code. These blocks of code represent one specific feature on a web application. They capture and contain one specific code state, that reproduces one specific behaviour. You can switch on a capability to give a web application one specific feature. Behaviours categorise program behaviour into clear and recognisable shapes and functions. They keep development neat. Some examples of recognisable shapes and functions from program behaviour include Forms for user research, Timelines for tracking events and actions on a continuum, and API for integrating one platform with other third party apps to increase functionality.

How Codebots uses behaviours

When we create a new function, if we think it will be useful to reuse, we teach a codebot how to create that function. We write the code for it in a module that can be reused, and then let the codebot access those modules and show them to users. This way, other people can use the program functions without having to write all the code for it. You can turn a capability on, and let the codebot access the modules, and you can turn that capability off if you need to.

Our most mature codebot - LAMPBot - already knows a lot of behaviours. And when working with different LAMPBot projects, behaviours can be either inherent or optional. Inherent behaviours are used in every LAMPBot project, without you having to activate them. Most behaviours are optional, and you will need to switch them on to make use of them. Some behaviours have been used by lots of different people in lots of different ways, and some haven't been used much at all. We are constantly teaching LAMPBot - and our new generation of codebots - new behaviours. With a growing collection, and a broad range of functions, it's very unlikely that you will ever need to know all of them to build the project you want with Codebots.