C4 Entities Across Backends¶
Each C4 concept has a different spelling in the portable core, in Structurizr and in LikeC4. This table is a general view: it points you to the right call, and the details differ per backend. Follow the links in the Structurizr and LikeC4 columns for the exact call, the generated output and the view that shows it.
General view, backend details elsewhere
Structurizr has C4 kinds built in and uses tags and shapes for external
systems and databases. LikeC4 has no C4 kinds, so you declare them in the
specification, for example with project.specification.use(C4). The LikeC4
helpers (model.person(...) and the others) need those kinds declared and
are shortcuts for element("person", ...). One table cannot hold all of that. Read the
Structurizr or
LikeC4 cheat-sheet for the full
answer. For the difference between the models, see
Two authoring models.
| C4 concept | Portable | Structurizr | LikeC4 |
|---|---|---|---|
| Person | Person, PersonExt |
model.Person(...) |
model.person(...) |
| Software system | System, SystemExt |
model.SoftwareSystem(...) |
model.system(...) |
| Container | Container |
model.Container(..., owner=system) |
system.container(...) |
| Component | Component |
model.Component(..., owner=container) |
container.component(...) |
| Database | ContainerDb, ComponentDb |
Container with the Database tag |
model.database(...) |
| External | SystemExt, ContainerExt, ComponentExt |
The External tag |
model.external(...) |
| Boundary | SystemBoundary, ContainerBoundary |
Drawn around the view scope | Nested elements |
| Deployment | DeploymentDiagram, DeploymentNode |
DeploymentEnvironment and nodes |
deployment.node(...) |
| Relationship | Rel |
Rel or uses (details) |
Rel or uses (details) |
| Views | One diagram class per view type | ContainerView and others |
element_view with predicates |
Names for display text¶
The three backends call the display text of an element or a relationship by different names. Each name is the word of that backend's own DSL, and the meanings differ, so the names are not unified. What is shared is the call shape: the first positional argument is the display text, and everything else is passed by keyword.
| Portable | Structurizr | LikeC4 | |
|---|---|---|---|
| Element display text | label |
name |
title |
| Element short text | summary |
||
| Element long text | description |
description |
description |
| Relationship display text | label |
description |
title |
| Relationship long text | description |
description |
The same relationship reads the same way in all three backends:
a >> "calls" >> b
a >> Rel("calls") >> b
a.uses(b, "calls")
The portable Rel("calls", "long text") reads its second argument as
description. In Structurizr and LikeC4 only the first argument of Rel is
positional; pass description and technology by name, as in
Rel("calls", technology="HTTPS"), so the code reads the same in every
backend.