An object class defines the abstract characteristics of an object, which include properties and the use cases that can be executed on the instances of the object class.
Syntax |
class<metaclass> reference : baseclass { |
In Fabasoft Folio, each object class is an instance of a meta class that defines the characteristics of the object class itself.
The meta class is specified in angle brackets following the class keyword. The definition of the meta class is optional. When omitted, COOSYSTEM@1.1:ObjectClass is used as the meta class of the object class.
Usually, you will use one of the following meta classes for defining a new object class:
If you want to use a different meta class, you can specify the reference of the meta class in the angle brackets following the class keyword.
Each object class in Fabasoft Folio must have a base class which must either directly or indirectly be derived from object class COOSYSTEM@1.1:Object. This object class is the base class of all other object classes.
The base class is specified after a colon following the reference of the newly defined object class.
If you do not find a more specific base class that is appropriate for your new class, you will usually derive it from one of the following most common base classes:
Example |
objmodel APPDUCXSAMPLE@200.200 // New object class for storing resources that is derived from // New object class for specification documents that is derived from // New object class for projects that is derived from |
Besides choosing the meta class and the base class, you can also define several other aspects of the object class, such as whether it should be abstract, programmatic, common, deriveable or compound.
The abstract keyword allows you to define an abstract object class.
An abstract object class can only be used as a base class from which child object classes may be derived, and which cannot be instantiated itself.
Example |
objmodel APPDUCXSAMPLE@200.200 class Vehicle : BasicObject { class Car : Vehicle { |
Using the programmatic keyword, an object class can be marked as not creatable by a user via the user interface. Thus, for example, the object class is not available in the “Object” > “New” dialog but objects of the object class can be created programmatically.
Example |
objmodel APPDUCXSAMPLE@200.200 class Order : BasicObject { |
Using the compound keyword, an object class can be marked as compound. Only the instances of a compound object class are displayed in the tree view on the left-hand side of the Fabasoft Folio Web Client.
Example |
objmodel APPDUCXSAMPLE@200.200 class Product : CompoundObject { |
Using the common keyword, an object class can be marked as a common class. This means that this class is creatable or usable in common locations like in a folder (i.e. in the COOSYSTEM@1.1:objchildren property). Using the allowcommonclasses keyword with a property can be marked as a property for containing common classes.
Example |
objmodel APPDUCXSAMPLE@200.200 class Product : CompoundObject { |
Using the derivable keyword, an object class can be marked as derivable. This means that classes from other software components can use this class as base class.
Example |
objmodel APPDUCXSAMPLE@200.200 class Product : CompoundObject { |