Diagram Language
TL;DR
We are not artists but engineers. why don't we use a diagram as a language?
You don't need to be a designer. C4 Diagrams provide a simpler and more focusing on an architecture.
Background
There are some diagram languages for visualizing software components. But, I've extended most popular tools in the dacusaurus engine.
- Mermaid
- Plantuml
- Kroki (for C4, Structurizr and D2 extension)
There is no standard tools so it can be hard to decide which one is best. They have pros and cons. I think we can select based on your purpose. Mermaid is easy to understand and more simple notation. Plantuml is more complex but can make software components like UML. In the Kroki, I added C4 and D2 which is more specific for software architeture.
In this document, I'll explore C4 diagrams which is offering the necessary leve of detail for most software development.
C4
C4 stands for Context, Container, Component and Code Diagram. It's a set of hierarchical diagrams that represent the different levels of abstraction of a software system.
Diagram Notation
- Person -
Person(alias, "label", "desc")Element presenting users or roles of a software system - Software system -
System(alias, "label", "desc"),System_Boundary(){ }Topmost level in abstractions that represent the value of existing systems or systems under development and the interaction between those systems - Container -
Container(alias, "label", "tech", "desc"),Container_Boundary() { }Element representing the internals of software systems; usually applications or solutions for data storage. A different concept to containers in Docker. The examples of a container are servers or client applications (for example, web, mobile, or PC), CLI applications, batch processes, databases, blob storage, file systems, or shell scripts. It mainly refers to a software that is independently deployed. - Component -
Component(alias, "label", "tech", "desc")Abstraction element representing the internals of the container of such modules or a set of interfaces that can be grouped as a functional unit. In Java or C# terms, they can be seen as a set of classes implemented for interfaces or packages. They differ from containers as these cannot be deployed independently. - Relations Representing dependencies or data flow between abstraction elements
Level 1: Context diagram
It shows the high-level relationships between the system and the people, systems, and external entities that interact with it.
Level 2: Container diagram
This diagram zooms into the system and shows its major software or hardware components (containers), such as web servers, databases, desktop applications, mobile apps, etc. The Container Diagram provides a more detailed view of the system's architecture, but still remains high-level enough to be easily understood by non-technical stakeholders.