-
Notifications
You must be signed in to change notification settings - Fork 39
Relationships
Yan Justino edited this page Apr 1, 2021
·
2 revisions
- 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.
In C4S
you should use operators to specify the direction of relationship. For this, just compare C4 Structures using >, <, >=
:
- Forward relationship with label and description
(Customer > WebApp)["Uses", "HTTPS"]
- Back relationship with label
(Customer < MailSystem)["Sends e-mails to"]
- Back relationship with label and description
(SqlDatabase >= BackendApi)["Uses", "async, JSON/HTTPS"]
- 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]