Modelling

The C4 model can be used irrespective of whether you use a diagramming or modelling tool, but there are some interesting opportunities when you progress from diagramming to modelling. With a modelling tool, you’re building up a non-visual model of your software architecture (a single definition of all elements and the relationships between them), and then creating different views (that become diagrams) on top of that model. This requires a little more rigour, but the problems can be resolved - modelling tools can understand the semantics of what you’re trying to do, provide additional assistance, and renaming elements/relationships is easy.

Software architecture models are essentially just directed graphs, consisting of nodes and edges, with diagrams showing a subset of the graph. Once you see the separation of the model (which is just structured data) and the views (which are rendered as diagrams), you quickly see there are a number of interesting opportunities that arise:

  • Creating alternative visualisations to help understand large and complicated architecture models - see Does the C4 model scale? for more.
  • Querying the model.
  • Exporting the model to other tools.
  • etc

A model is just data! And we, as software developers, have an endless supply of tools to visualise and manipulate that data.

Tools

Here are some modelling tools that support the C4 model.

Tool Description
Archi The Open Source modelling toolkit for creating ArchiMate models and sketches. Used by Enterprise Architects everywhere.
C4InterFlow Architecture as Code (AaC) framework that generates diagrams and lets you analyse Application Architecture. Inspired by C4 Model.
Gaphor A picture is worth a thousand words. Describe and document your applications and systems with Gaphor to enhance knowledge sharing.
Model Create your software architecture models and diagrams in Go.
Overarch Overarch provides a data model for the holistic description of a software system, opening multiple use cases on the model data. Supports C4 and UML diagram generation with PlantUML.
pumla pumla - systematic re-use of model elements described with PlantUML.
PyStructurizr A Python DSL inspired by Structurizr, intended for generating C4 diagrams.
RDB modeling This application allows to create and visualize software architecture using a simplified version of the C4 model and YAML.
Structurizr builds upon “diagrams as code”, allowing you to create multiple software architecture diagrams using the C4 model, in a variety of rendering tools, from a single model.