Domain Model Overview in the Web Modeler

Last update: Download PDF Edit

1 Introduction

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 the Web Modeler consists of the following:

To view the Domain Models of your app in the Web Modeler, click the Domain Models icon in the left menu bar of the Web Modeler.

After opening a domain model, you will see an overview of all the entities, attribute, and associations of the entities.

The Auto Arrange option above the domain model auto-arranges the entities. You can click it several times to get the view that you like.

2 Components

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.
Name
Persistablity
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
Type
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
Multiplicity
Delete behavior

For examples and more technical details, see Domain Model, Entities, Attributes, and Associations in the Desktop Modeler category of the Mendix Reference Guide.

3 Adding New Entities

You can add new entities in the Toolbox.

To add an entity, do the following:

  1. Open the Toolbox tab of the domain model.

  2. Drag and drop New Entity to the working area.

  3. 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:

  1. Select a block with entity you want to add attribute to. The New attribute option appears:

  2. Click New attribute and specify its Name and Type:

  3. Click Create.

New attribute is added to the entity.

5 Adding New Associations

To add association in the domain model, do the following:

  1. Select a block with entity you want to add association to.
  2. Click the arrow icon that appears:

  3. 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.

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:

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.

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 in the Web Modeler.

7 Deleting Entities, Attributes or Associations

To delete the entity, attribute or association, do the following:

  1. Select the entity, attribute or association you want to delete.

  2. Press Delete or click the Delete button at the bottom of the Properties tab.