Simon Brown discusses the common issues with software architecture diagrams, noting that many people avoid UML due to its complexity and perceived irrelevance in agile environments. He points out that free-form whiteboard drawings often lack clarity and consistency, leading to ineffective communication. Examples of confusing and uninformative diagrams are shown, illustrating the failure to convey meaningful architectural information.
Brown argues for a more structured, engineering-like approach to diagramming, contrasting it with the 'artistic' approach often taken. He emphasizes that clear communication is crucial for team velocity and shared understanding, especially for diverse audiences beyond just developers. He advises thinking like a developer, not an architect, to create diagrams that reflect reality and are easily understood by those implementing the code.
The speaker stresses that the abstractions (the 'things' being diagrammed) are more important than the specific notation. He uses a map analogy: different maps may use different symbols but convey the same fundamental information if a key is provided. This leads to the idea of clear abstractions as the foundation, with notation being secondary but supported by a legend.
Brown introduces the C4 model, standing for Context, Containers, Components, and Code, which provides four levels of abstraction for describing software architecture. He clarifies the definition of 'container' (an application or data store that needs to be deployed) and 'component' (a grouping of code within a container). The C4 model offers a hierarchy for understanding a system at different levels of detail, similar to zooming in and out on a map.
The first level is the System Context diagram, which shows the system under development, its users, and other interacting systems. An example of an internet banking system is used, illustrating how to depict the banking system, its users, a mainframe banking system, and an email system. This diagram provides a high-level overview suitable for a wide range of audiences.
The second level is the Container diagram, which zooms into the system to show deployable applications and data stores (containers), their technologies, and how they interact at runtime. The internet banking example is expanded to include a web application, a single-page application, a mobile app, an API application, and a database, demonstrating inter-process communication.
The third level is the Component diagram, which delves inside a container to show its internal structure, specifically the components (groupings of code) and their interactions. For the internet banking system's API application, components like a sign-in controller, security component, accounts summary controller, and mainframe banking system façade are depicted, aligning with the actual code structure.
The final level is the Code diagram, which shows the internal structure of a component (e.g., classes and interfaces). Brown strongly advises against manually creating Level 4 diagrams, as they are often not worth the effort and can usually be generated automatically by IDEs, stating that 99% of situations don't require drawing them manually.
Brown provides practical tips for effective notation: always title diagrams clearly with type and scope, use sticky notes for iterative layout, maintain visual consistency across diagram levels, and be cautious with acronyms (focus on domain-specific ones). He emphasizes adding sufficient descriptive text within boxes to make diagrams self-explanatory, contrasting this with vague, unlabeled boxes that require verbal explanation.
For lines (relationships), unidirectional arrows are preferred, with a clear description of the interaction (e.g., 'calls', 'depends on'). While most relationships are bidirectional, it's better to summarize the intent in one arrow to avoid clutter, unless the two directions have fundamentally different natures. Explicitly stating what the arrow represents (e.g., 'makes API calls using') dramatically improves clarity.
Every set of diagrams should include a consistent key or legend to explain shapes, colors, line styles, and icons. This ensures that even seemingly obvious visual cues are understood by all. Brown advises using shape and color to complement, not solely convey, information. Icons can add an extra layer of information, but the diagram should still make sense if colors and icons are removed, relying on the textual descriptions for fundamental understanding. The goal is for diagrams to be self-standing, reducing the need for constant verbal explanation.
Brown recommends avoiding general-purpose diagramming tools like Visio, OmniGraffle, and Gliffy, as they lack software architecture-specific knowledge. Instead, he suggests tools like C4-PlantUML, which use text-based definitions to automatically generate diagrams, or his own dedicated C4 model tooling. The key takeaway for tooling is to prioritize abstractions first, then notation, ensuring everyone understands the four levels of the C4 model.