vFunction Logo

In this section of the hands-on, we will focus on Order Controller domain.

Entry Point

The names of the domains are derived from the classes that own the end points through which clients access the domain. These endpoints are called entry points.

  1. In the Analysis tab, click on the Order Controller domain.

    analysis

  2. To review the entry points for Order Controller domain. Click on EXPLORE TREE next to “3.Entry Point”.

    • On the left pane, you see the three endpoints.
    • In the center pane, you can see a call tree provided by dynamic analysis for “OrderController.createMultipleOrders()”, you can also view the call tree for other two by click on view for the respective controller.

    analysis

  3. Clicking the left-most arrow in the call tree will take you up the tree, shows the calling nodes.

    analysis

Dynamic Classes

  1. Click on Back to Domains to go back to the domain view

    • The Dynamic class exclusivity is 100% - this means that the classes identified by the dynamic analysis flows are used exclusively by this domain.
    • Click VIEW next to the Dynamic classes, you will see:
      • Two, exclusive classes (OrderController and OrderService) classes used exclusively by this domain
      • Zero, non-exclusive classes classes used by other domains
      • One, Common class (Logger).
        • Common classes are classes marked to be included in a jar used by all domains as a library. We name this jar common jar.

    analysis analysis analysis

Static Classes

  1. Click on Back to Domains

    • The Static class exclusivity is 20%.
    • Click VIEW next to the static classes, you will see:
      • Two, exclusive classes
      • Eight, non-exclusive classes; hence the 20% value (2 out of 10).
      • One, Common class (Logger).

    analysis analysis

  2. Click on the NON list to view the 8 non-exclusive classes.

    • Click on the BillToAddress class
      • It belongs to the package com.oms.entity, which contains entity classes (the E tag to the right of the class name in the list is an indication that the class is an entity class).
      • We will add all the entity classes into the common jar. This is of course a design decision, and one may decide to try and add only the relevant entities to each domain.
      • Click MARK PACKAGE AS COMMON, leave the package name as com.oms.entity, and click SUBMIT.
    • The analysis will automatically re-run, and we will remain with a single non-exclusive class – SalesOrderRepository.

    analysis analysis analysis

  3. After the analysis is complete.

    • Click SalesOrderRepository and then on the DETAILS next to “Not exclusive to domain”.
    • You will see that this class is being used by two domains: OrderController and ModifyFulfillmentController.
    • Click on OrderController - a graph like the one below appears in the center pane, It shows that:
      • The class OrderService is referencing SalesOrderRepository as a bean (dashed arrow).
      • And it is referencing SalesOrder as a compile-time dependency (solid arrow).
      • Also, SalesOrderRepository references SalesOrder.

    analysis analysis analysis

    • Click again on Details of SalesOrderRepository, but now select ModifyFulfillmentController to see how that domain references the SalesOrderRepository class.

    analysis analysis

    Since SalesOrderRepository is a JPA repository used only by these two domains “OrderController” and “ModifyFulfillmentController”, keep this class non-exclusive in the analysis. This means the class will be duplicated into both domains.

Resources

Resources are external virtual or physical objects used by the domains such as database tables, files, transactions, spring beans, network sockets, and more.

  1. Go back to the domains list and open click VIEW next to “Order Controller Resources”.

    analysis

    • OrderController has nine exclusive resources (The resource used exclusively by this domain)
    • And nine non-exclusive resources (resources shared with other domains).

    analysis

    • Click on the NON filter to view the non-exclusive resources.
      • You can see a list of database tables used by the Order Controller domain, which are shared by others.

    analysis

  2. Click Details on a table to see which other domains use it.

    analysis analysis

  3. The NON list includes a file resource: “oms-log.txt”.

    • Clicking Details will show that many domains write to this file.

    analysis

    • Mark this file as common to indicate that this resource is shared across all domains and should not affect resource exclusivity.

    analysis

    • Click Back to Domains analysis

Wrap Up

Now lets move to analyzing the InventoryController domain.

vFunction Logo