vFunction Logo

Architectural Rules

In this section, we will show how to define architectural rules. vFunction validates the rules and if violated it adds the appropriate TODO items.

  1. Switch to the Analysis page, and click Architecture Rules under Actions in the left pane.

  2. The Application Rules window opens and you will see there the default rules:

    Default Rules

    Rule 1 means that external components (consumer) are allowed to call services tagged with API service

    Rule 2 means that vFunction should alert (notification + TODO) if an external component (consumer) calls a service tagged any service

    Rule 3 means that vFunction should alert if a service tagged core-service us calling a service tagged any service

  3. Let’s add some tages to services and see these rules in actions:

    a. Close the rules window

    b. Select the oms-shipping service in the graph and click on the … icon (alternatively you can click the pencil icon next to the name in the right pane)

    c. In the dialog click on the + next to Add Tags (Optional)

    d. Add the tag #core-service and Save - you should now see the service sphere in the graph annotated with #

  4. Reopen the architecture rules window and click on Execute Dry Run columns header - you should get the following result:

    Rule Dry Run

  5. Open the TODO items - you should see TODO items with the event RULE VIOLATION, mentioning the rule number and having more details in the description.

Creating new rules

  1. You can create new architecture rules by going back to the Application Rules window (Architecture Rule under Actions), the rules can reference domains directly by selecting them by name or it can be applied through tags.

  2. The same dialog (Add Tags) accessible for services can be used to add new user-defined tags by simply typing a new tag name.

    Add New Tag

vFunction Logo