How to Organize Domain and Implementation Model?
This tutorial is aimed to introduce the concept of organizing project with the use of model. By reading this tutorial, you will learn how to create domain model, how to transcribe it into implementation model, and eventually compare their differences.
Creating a Domain Class Model
- Create a new project by selecting Project > New from the application toolbar. In the New Project window, enter Order Processing as the project name and click Create Blank Project.
- Open the Project Browser by selecting View > Project Browser from the application toolbar.

- Open the Model Structure page.

- On the left-hand side, keep the project node selected in the list and then click New Model.

- In the Model Specification window, enter Domain Model as the model name. Click OK to confirm.

- Keep Domain Model selected in the list. Then, click Add New Diagram.

- In the New Diagram window, select Class Diagram and then click Next to continue.

- Keep the diagram name unchanged and then click OK to create the diagram.
- Draw a domain model class diagram like this:

Creating an Implementation Class Model
Having completed the domain model, we are going to transcribe it into an implementation model.
- Right-click on the diagram background and select Utilities > Transit to New Diagram... from the popup menu.

- In the Select Parent Model of New Diagram window, select the project root node.

- Click New Model at the top right of the window.
- In the Model Specification window, enter Implementation Model as the model name. Click OK to confirm.

- Keep Implementation Model selected, and click OK to confirm. This creates a new diagram named Implementation Model, which looks the same as Domain Model. What we are going to do is to refine the design to make it an implementation model.
- Delete the Customer class by selecting it and pressing the delete key.
- Rename class Order line to OrderLine.
- Create a class OrderController.
- Add an operation createOrder() : Order into OrderController.
- Right-click on the operation createOrder() : Order, and select Show Dependencies from the popup menu.
Up to now, the implementation model should look like this:
Using the Model Transitor
Let's refresh our memory on what we have changed for the class OrderLine.
- Move your mouse pointer over the class OrderLine.
- Click on the Model Transitor resource icon at the bottom right of the class shape and then select Transit From > Domain Model.Order line from the popup menu.
This populates the domain model, with the former version of class OrderLine selected, which was named Order line.
Comparing Models with Visual Diff
To identify all the refinements made in the implementation model, we need to use the Visual Diff tool.
- Open Visual Diff by selecting Modeling > Visual Diff from the application toolbar.
- In the Visual Diff window, select Transitor as the Strategy.

- We want to know the changes in model element details rather than view details such as shape coordinates. Therefore, next to Strategy, we select Model Element to Compare.

- For the diagram pane on the right, keep Use Working Project selected and pick Implementation Model for the diagram to compare.

- Now, we have obtained the differences between the domain (left-hand side) and implementation (right-hand side) models in the bottom pane. Click on the node OrderController (New). From the tag (New) and from the diagram, we know that it is newly added in the implementation model.
- Select and expand the node Order line (Modified). We know that it has been renamed.

- Select the node Customer (Deleted). We can see that it no longer exists in the implementation model.
