Create a simple UML domain model for Java code generation using Enterprise Architect

This is a small tutorial on how to model a very simple Domain Model, as a UML Class model.
This model can be used for code generation using TRIMM Java – see

Model your domain model in UML using Enterprise Architect (EA)

You can also use MagicDraw to UML model your domain model – this will be covered in a later tutorial

1 Start Enterprise Architect

Start Enterprise Architect

Start Enterprise Architect

2 Create a EA Project file name and location

From the Open Enterprise Architect Project dialog press the New Project button

New EA project

New EA project

3 Select New EA Project location

Select the model folder within the folder where the Maven project was created in Step 1 (e.g. C:\TRIMM-examples\simplejavaproject\model) and give the project a name, e.g. SimpleJavaModel.eap

Save the new Simple Java Domain Model project EAP file

Save the new Simple Java Domain Model project EAP file

4 Select Domain Model from Model Wizard

From Basic UML 2 Technology select Domain model

Select Domain Model from Model Wizard

Select Domain Model from Model Wizard

5 Delete example classes and diagram

The wizard creates an example model which we don’t want to use, so you have to manually delete those until the contents look like the image below

Empty EA Domain Model project

Empty EA Domain Model project

6 Add new Diagram

Right click the Model element and select Add > Add Diagram…

Add Diagram

Add Diagram

7 Select Class diagram type

From UML Structural select Class diagram type and give it a name (e.g. model)

Select Class diagram type

Select Class diagram type

Which gives this result

Class diagram added

Class diagram added

8 Select Class from the toolbox and click the diagram canvas to add it

Add a Class called Member

Add a Class called Member

9 Add Attributes to the Class called Member

Right click the class called Member and select Attributes…

Add Attributes to Class

Add Attributes to Class


Add New Attribute

Add New Attribute

In Name enter email
In Type enter String
Click Save

Press New to add a new Attribute

To complete the Class Member add all following attributes:

Name Type
email String
firstName String
lastName String
numberOfActiveMembers int
mayContact boolean

< Back