Skip to content

Relationships

Yan Justino edited this page Apr 1, 2021 · 2 revisions

Notation

  • Every line should represent a unidirectional relationship.
  • Every line should be labelled, the label being consistent with the direction and intent of the relationship (e.g. dependency or data flow). Try to be as specific as possible with the label, ideally avoiding single words like, "Uses".
  • Relationships between containers (typically these represent inter-process communication) should have a technology/protocol explicitly labelled.

C4S Examples

In C4S you should use operators to specify the direction of relationship. For this, just compare C4 Structures using >, <, >=:

Forward relationship

  • Forward relationship with label and description
(Customer > WebApp)["Uses", "HTTPS"]

Back relationship

  • Back relationship with label
(Customer < MailSystem)["Sends e-mails to"]

Bidirectional relationship

  • Back relationship with label and description
(SqlDatabase >= BackendApi)["Uses", "async, JSON/HTTPS"]

Positions

  • It's forces the position between elements
(BackendApi > BankingSystem)["Uses", "sync/async, XML/HTTPS"][Position.Down]
(BackendApi > BankingSystem)["Uses", "sync/async, XML/HTTPS"][Position.Up]
(BackendApi > BankingSystem)["Uses", "sync/async, XML/HTTPS"][Position.Left]
(BackendApi > BankingSystem)["Uses", "sync/async, XML/HTTPS"][Position.Right]
(BackendApi > BankingSystem)["Uses", "sync/async, XML/HTTPS"][Position.Neighbor]