Relation Perspectives

Relation perspectives show relations between resources flowing from left-to-right (or top-to-bottom). Relation diagrams are perfect for showing dependencies, ownership, responsibility and other relations between your resources. Generally, relation (and ring) diagrams are best for showing static relationships between resources, while sequence perspectives are best for showing dynamic relationships.

To create a relation perspective, simply declare relations in your perspective using the relations property.

Basic relations

In IDL, relations are defined like so:

# Resource tree omitted
...
perspectives:
- name: Service
  relations:
  - from: MiniChat
    to: WhosWho
  - from: Quick Send
    to: WhosWho
  - from: Quick Send
    to: LongStore
...

When rendered, this perspective might look like the following:

Though there isn’t much detail yet, this perspective shows which services (WhosWho and LongStore) are used by which applications (MiniChat and Quick Send).

Combining relations using commas

We can combine two of the above relations by defining multiple resources in the to property, separated by commas:

...
  relations:
  - from: MiniChat
    to: WhosWho
  - from: Quick Send
    to: WhosWho, LongStore # Use commas to separate resources
...

This short-hand can be used wherever resources are referenced.

Relation labels

We can make relations more explicit by adding labels to their arrows:

...
perspectives:
- name: Service
  defaultRelationLabel: Depends On
  relations:
...

All of the arrows in this perspective are now labeled:

As the name defaultRelationLabel implies, this label is used only for relations that don’t have an explicit label. Use the label property set the arrow label on individual relations:

...
  - from: Quick Send
    to: WhosWho
    label: Uses
...

Relation descriptions

If you would like to say more about a relation than will fit in a label, you can add that in its description property.

...
  - from: Quick Send
    to: WhosWho
    label: Uses
    description: Retrieves user information and permissions
...

The description appears when the user mouses-over the relation label. On mobile, the description appears when the user taps the label.

Last updated on 27 Apr 2020
Published on 27 Apr 2020