Jump to Menu

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.

Compatible edition(s): Enterprise, Professional, Standard

  • May 04, 2016
  • Views: 106,113
  • PDF

Creating domain class model

  1. Create a new project by selecting Project > New from the application toolbar. In the New Project window, enter Order Processing as project name and click Create Blank Project.
  2. Open the Project Browser by selecting View > Project Browser from the application toolbar.
    Open Project Browser
  3. Open the Model Structure page.
    Open model structure tab
  4. On the left hand side, keep the project node selected in the list and then click New Model.
    New model
  5. In the Model Specification window, enter Domain Model as model name. Click OK to confirm.
    Entered model name
  6. Keep Domain Model selected in the list. Then, click Add New Diagram.
    Add new diagram
  7. In the New Diagram window, select Class Diagram and then click Next to continue.
    Selected class diagram
  8. Keep the diagram name unchanged and then click OK to create the diagram.
  9. Draw a domain model class diagram like this:
    Domain class diagram

Creating implementation class model

Having completed the domain model, we are going to transcribe it into implementation model.
  1. Right-click on the diagram background and select Utilities > Transit to New Diagram... from the popup menu.
    Transit to new diagram
  2. In the Select Parent Model of New Diagram window, select the project root node.
    Select project root node
  3. Click New Model at the top right of window.
  4. In the Model Specification window, enter Implementation Model as model name. Click OK to confirm.
    Naming model
  5. Keep Implementation Model selected, click OK to confirm. This forms a new diagram with name Implementation Model, which looks the same as Domain Model. What we are going to do is to refine the design to make it become an implementation model.
  6. Delete the class Customer by selecting it, and hit the delete key.
  7. Rename class Order line to OrderLine.
  8. Create a class OrderController.
  9. Add an operation createOrder() : Order into OrderController.
  10. Right-click on the operation createOrder() : Order, select Show Dependencies from the popup menu.
    Show dependencies
    Up to now, the implementation model should look like this:
    Implementation class diagram

Using Model Transitor

Let's refresh our memory on what we have changed for the class OrderLine.
  1. Move your mouse pointer over the class OrderLine.
  2. 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.
    Using Model Transitor
    This populates the domain model, with former version of class OrderLine selected, which was named Order line.
    Class selected

Comparing models with Visual Diff

In order to identify all the refinements made in implementation model, we need to make use of the Visual Diff tool.

  1. Open Visual Diff by selecting Modeling > Visual Diff from the application toolbar.
  2. In the Visual Diff window, select Transitor as Strategy.
    Select transitor as strategy
  3. We wanted to know the changes of model element details rather than view details such as shape coordinate. Therefore, next to Strategy we select Model Element to Compare.
    Select model element to compare
  4. For the diagram pane on the right, keep Use Working Project selected, and pick up Implementation Model for the diagram to compare.
    Select diagram to compare
  5. Now, we have obtained the differences between domain (left hand side) and implementation (right hand side) model, at 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.
    Selecting new class
  6. Select and expand the node Order line (Modified). We know that it is renamed.
    Selecting modified class
  7. Select the node Customer (Deleted). We can see that it does not exist anymore in the implementation model.
    Selecting deleted class

创造美好 共同成长

We use cookies to offer you a better experience. By visiting our website, you agree to the use of cookies as described in our Cookie Policy.

OK