The domain model is a data model that describes the information in your application domain in an abstract way. It is central to the architecture of your application.
The domain model in Studio consists of the following:
Let us say you have a collection of CDs like the one in the table below.
|How to Dismantle an Atomic Bomb||U2|
|Exodus||Bob Marley & The Wailers|
The rows in the table are CDs. The type of the two rows is “CD” and this is the entity name. A specific CD like “How to Dismantle an Atomic Bomb” of the band U2 is called an object of the “CD” entity. Characteristics like the “Title” and “Artist” are called attributes.
To view the Domain Models of your app in Studio, click the Domain Models icon in the left menu bar of Studio.
After opening a domain model, you will see an overview of all the entities, attribute, and associations of the entities.
The complexity of your domain model depends on the complexity of your app.
The Auto Arrange option above the domain model groups and aligns entities by associations. Entities with no associations will be vertically aligned.
|Domain model components||Description||Properties|
|Entity||An entity represents a class of real-world objects, such as customers, invoices, work items, etc.
If we draw a parallel with databases, the entity is a table.
|Attribute||Attributes are characteristics that describe and/or identify the entity. For example, a Customer entity typically has attributes for the name of the customer, an e-mail address, and other personal information. If we draw a parallel with databases, the attribute is a column.||Name
|Association||An association describes a relation between entities. In the domain model, an association is represented by a line/arrow between two entities. If we draw a parallel with databases, the association is a foreign key.||Name
3 Adding New Entities
You can add new entities in the Toolbox.
To add an entity, do the following:
Open the Toolbox tab of the domain model.
Drag and drop New Entity to the working area.
Fill out the name for it and click Create:
The new entity is added to the domain model.
4 Adding New Attributes
To add attributes in the domain mode, do the following:
Select a block with entity you want to add attribute to. The New attribute option appears:
Click New attribute and specify its Name and Type:
New attribute is added to the entity.
5 Adding New Associations
To add association in the domain model, do the following:
- Select a block with entity you want to add association to.
Click the arrow icon that appears:
Select a second entity for the new association from the list of existing entities and click Select. You can also create a new entity for the association from the dialog box.
The module is indicated next to the entity name in the brackets. If you select the entity from another module, you will create a cross- module association. For more information, see section 5 Cross-Module Associations in Association Properties. The entities of the current module are listed first.
6 Specifying Properties
In the domain model, you can manage the properties of the entities, attributes, and associations on the Properties tab.
At the bottom of the tab you can see the Delete button.
6.1 Specifying Entity Properties
You can manage the following properties of an entity:
The Name of the entity
Persistability of the entity
To change the entity properties, click the entity in the domain model. The Properties tab for the selected entity is displayed automatically.
6.2 Specifying Attribute Properties
You can manage the following properties of an attribute:
- The Name of the attribute
The Type of the attribute
To change the attribute properties, click the attribute in the domain model. The Properties tab for the selected attribute is displayed automatically.
Fields that are displayed in Properties may vary depending on the type of the attribute.
6.3 Specifying Association Properties
You can manage the following properties of an association:
- The Name of the association
- Multiplicity of the association
- The delete behavior of the objects
For more information, see Association Properties.
To change the association, click the line in the domain model. The Properties tab for the selected entity is displayed automatically.
If the association type is one-to-many or many-to-many, you can swap direction of it clicking the corresponding icon. For more information, see section 3 Multiplicity in Association Properties.
7 Deleting Entities, Attributes or Associations
To delete the entity, attribute or association, do the following:
Select the entity, attribute or association you want to delete.
Press Delete or click the Delete button at the bottom of the Properties tab.