class - Dbquity model BETA

page modified: 2024/04/16 18:37:57

A structured piece of data and functionality

A class declares one or more fields defining what data is contained within an instance of the class. A class instance can only be saved as a field of an entity - not by itself.

Declaration

class <name>
    ...

or; for an class that derives from a <base-class>

class <name>
    base: <base-class-name>
    ...

or when declared outside an area at the root of the model (in short-hand)

<base-class-name> <name>
    ...

When declaring a class, the first line captures the name and potentially - when declared at the root of the model - the base of the class.

The following, indented lines are used to further declare the characteristics of the class using nested fields and these modifiers and properties:

Modifiers

Properties

Expression syntax

A class implicitly declares a constructor function, which is named the same as the class with a parameter for each field. When calling, both positional (per the position of the field declarations) and named parameters are supported.

Notes

A class may declare static function members.