A renderer is basically the tool that defines how a canvas entity behaves. A renderer encapsulates all the knowledge about variables and capabilities to take an action using the entity.
Renderer is the element that tells how you map your domain entity to a display item.
Before diving into details, a simple example to a renderer might be the “Select Box” renderer. Heuristically, Select Box is used when one wants to pick some entity from a list of entities. So we might need a couple of variables to support the Select action:
- A list of entities to pick one from: initialvar, with cardinality “many”, as a list can and often do contain more than one entity.
- The field of the entity to be shown on the list: selectbyvar (For example Name and Surname of a Personel), with cardinality “many”.
- The initially selected entity, to be seen when screen is first loaded: initialselectionvar,
- With cardinality “one”.
- The selected one: selecteditemvar, with cardinality “one”, as one can pick only one of the items in the list.
And to support styling, some other variables might be helpful:
- A label to the list: labelvar, with cardinality “one”.
- A variable to tell on which conditions the list will be visible on screen: visiblevar, with cardinality “one”.
- A variable that decides on which conditions the action “Select” can be done: enabledvar, with cardinality “one”.