The C4 approach
The C4 approach is about designing a system (or an application) with four different levels of granularity, moving from the context level in which the application is placed, to the container level that will show the different processes composing the application, to the component layer showing the different parts composing the process, and finally, to the code level, where we will find the classes and interfaces used to create the application. Here is the diagram for this approach:
Figure 7.1 – The levels in the C4 approach
Each level details the content of the previous level and gives a more detailed view of the application. The fact that units of the lower level always have to be related to one given unit of the upper layer also helps to correctly share responsibilities and maintain a low level of coupling.
In the following sections, we will draw the four levels for our sample system and software modules to show the methods; at...