Visualizing product architecture in C4 model

  • MS Visio and similar editors are cumbersome, say inconvenient. These tools were created for other purposes, and it is clear to see.
  • UML diagrams quickly increase in number, and soon enough it becomes difficult to maintain them. Moreover, in fact, it is always necessary to keep in mind the scale of the entire system.
  • 4+1 also has support and scale issues, high entry threshold for new team members.

Why create the C4 model

1. To help teams describe the architecture in both pre-design and retrospective documentation of the codebase.

Tools

To create such a model, we use the following stack:

  1. PlantUML allows you to generate UML diagrams from text;
  2. C4Builder provides export to PDF and other formats;
  3. IDE-plugin ensures automation and developer-friendly interaction with the model.

How quickly diagrams become obsolete in C4

Because of the hierarchical nature, each diagram will change at a different rate.

  1. System context: very slow in most cases because it describes the landscape in which the system operates.
  2. Containers: updated the more often you use microservices, serverless features, etc.
  3. Components. For any system under active development, component diagrams will change as the team adds, removes, or restructures code. As we said, this level is worth automating as much as possible.
  4. Code: class diagrams, for example, will potentially become obsolete very quickly. For this reason, it is recommended to (1) not create them at all or (2) create them on demand using tools such as your IDE.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store