Declaring classes
👉 Choose Domain model > Classes
in the main menu.
The purpose of classes in wyStack is twofold:
- Use classes to model records/objects that can be persisted in one of the datastores. (this is the primary use-case)
- Use classes to model objects that can be used in-memory. (this is an optional use-case)
Naming​
When you create a new class you have to provide a Name (singular) and also a Plural name.
Both plural and name are used in many places and are both required.
As an example:
- Name: Order
- Plural: Orders
Inheritance​
You can implement class inheritance as you would do in any object oriented language. If you don't specify any class to inherit from, persistent classes will inherit automatically from BaseEntity
, a base class for all persistent wyStack classes.
Properties​
In regular cases make sure that your class has a Name property, this can also be a ComputedProperty that combines a set of properties as a meaningful string. In some cases the UI requires a Name property to be present, for example in lookup lists.
Memory vs Persistent​
Use the Class type
property to configure a class as being persisted or not. Don't forget to configure the datastore when creating a persistent class.
Display​
Use the DISPLAY
tab to configure appearance properties for the class, like:
- Icon: The icon that is being used for the class.
- Color: The color that is being used for that icon. (background color)
- Abbreviation: Provide a short name for the class.
- Is live data: Automatically refresh the data at regular times.
- (Sub)title property/expression: Declare the property/expression to be shown when showing an entity's Title/Subtitle.
- Class group: Group the class together with other similar classes.