-
Notifications
You must be signed in to change notification settings - Fork 26
hs70
Object Oriented applications are based on models. This section covers the definition of the InstantObjects business model, which is the initial step in the creation of an InstantObjects based application. The InstantObjects Model Explorer is the central tool in this process. The InstantObjects business model consists of a collection of user designed classes, many of which are related through inheritance or association. Most if not all of the data controlled by these classes is required to be persisted or stored in such a way that the relationships among this data are retained. In addition to the simple class attribute types, which provide persistence for the Object Pascal equivalent simple types (eg string or integer) , the InstantObjects framework provides several class attribute types to facilitate the persistence of instances of related classes. These attribute types are known as relational or complex attributes.
Relational Attribute Types The relational types are: Reference, Part, References and Parts. It is important to understand the nature of the relationship that each of these attribute types provides so that the desired behaviour is reflected within the business model.
Container attributes is the collective name for the subset of relational types consisting of Parts and References type attributes.
Reference Reference is the simplest object relation supported by InstantObjects. A reference defines a unidirectional relation from one object to another.The object referred to lives outside the referring object and knows nothing about the relation itself. See TInstantReference class for more information.
Part Objects in Part relations are tied together more closely. A Part relation is bi-directional, meaning the object at each end of the relation knows about the object at the other end. The object referred to in a Part relation is considered to be a part of the owning object and as such can only be reached via the owning object. In addition, an object referred to in a part relation is disposed along with its owner. See TInstantPart class for more information.
References Like its singular counterpart, Reference, the References relation is unidirectional. But instead of just referring to a single object, a References relation can refer to any number of objects and thereby defining a one-to-many relation to objects outside of the referring object. See TInstantReferences class for more information.
Parts Parts is the one-to-many counterpart of the equivalent one-to-one relation type, Part. A Parts relation can refer to any number of objects that are all considered to be part of the referring object. See TInstantParts class for more information.
Parts and References are known as container attributes. When defining an attribute of one of these types, a corresponding array property and optional methods to access the container attribute are added to the class. For any of the relational types, the class of the related object(s) must be specified as the Object Class of the attribute.
Notes: For "External Storage support" of the Part, Parts and References attribute, refer to External Storage of Attributes.
See also:
- Home
- Glossary
- Project structure
- Installing InstantObjects
- User Guide for InstantObjects
- Creating the Business Model
- Creating the User Interface
- Programming with Persistent Objects
- Learning the Primer Demo