Objects and their relationships are precisely described in a domain model.
Entities, domains and contexts
We call entity an object which encapsulates persistent data, stored in a database. In the simplest cases, there is one entity type per database table, one entity instance per table row.
Entities are clustered into domains (ObjectDomain). Domains can be organized hierarchically: one domain is the parent of another domain if at least one entity of the former references one or several entities of the latter. Cycles are forbidden in this case. A domain corresponds to the combination of category and a component in the UML model.
At the application level, operations upon entities occur inside a context (ObjectContext). The context manages an entity cache called the LocalStorage. Internally, the LocalStorage leverages an ADO.NET DataSet object. Entities can be viewed as simple strongly-typed facades in front of the DataRows contained in the DataSet.
The context guarantees the identity of the entities, i.e. to one DataRow instance corresponds at most one entity, whatever the way you get to this entity. This feature is provided by the Entity aspect.
Simple references, multiple references and associations
Entities can reference one another. A reference is a relationship oriented from one source entity to one or several target entities. The cardinality of a reference corresponds to the maximum possible number of target entities. When the cardinality is 1, we say it is a simple reference. Otherwise, the relationship is a multiple reference.
A reference has a name which corresponds to the role of the target entities inside the relationship.
A reference corresponds to a half-association of the UML model. Conversely, an association in the UML sense can be built out of two references, one being the main reference, or parent reference, the other being the back reference, or child reference.
At the database level, a reference generally corresponds to a foreign-key column or to an associative table.
Domains, entities, properties and referencesThere is one EntityData object per entity of an object domain (EntityInfos),one PropertyData object per property of an entity (PropertyInfos),one ReferenceData object per reference of an entity (ReferenceInfos).
EntityData objects serve as a repository of extensible services to describe the metadata of an entity. The GetService method is used to retrieve a particular service identified by its interface.
PropertyData and ReferenceData operate in the same manner as regards properties and references.