C4 – architecture diagrams


We know and like UML, but we use it pragmatically. UML sequence diagrams work great in their field (for visualizing flows over time). We also often use activity diagrams. Simple use case diagrams are useful at the initial stage of requirements engineering. We practically do not use class diagrams. We have often been forced to use component diagrams to visualize the architecture of our applications. Somehow it never worked well. We often had the impression that the complex rules of UML notation of component diagrams and their rather detail level are suboptimal for a simple visualization of software architecture. Fortunately, we found a better tool for this purpose. C4 model. This model allows visualization of the software architecture on 4 levels: context, container, component and code. This is a very simple notation that allows you to gradually delve into the architecture of the information system. We start at a high level, from the context of our software with the user and 3rd party systems. From this level, we can zoom to containers (i.e. individual applications). Lower are the components (visualized definitely simpler than in UML component diagrams). If we need to, we can go to individual components to see the code structure (the C4 model does not define any notation at this level – masochists can use UML class diagrams ;-). C4 diagrams are working so far great for visualizing the architecture of the software we create. What pleases our programming souls is the ability to define all the first 3 levels of C4 diagrams using plain source code. Yes: we don’t draw our architecture. We write it!

strzałka do góry