Relations

The most important property of a perspective, other than its name, is its relations. Perspective relations define how resources are related to each other in a perspective.

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 2 Feb 2020
Published on 2 Feb 2020