
In the fast-paced world of Agile Enterprise Architecture, the pressure to document complex systems is often at odds with the need for rapid iteration. Static documentation often becomes obsolete the moment it is published. The solution lies in a methodology that prioritizes the question over the notation, combined with a “Diagrams as Code” workflow. This tutorial explores how the C4 model, augmented by supplementary UML views and powered by Visual Paradigm’s VPasCode, allows Agile teams to maintain a living, breathing architectural map.
The C4 Model: A Foundation for Context
The C4 model provides a standardized approach to describing software architecture. Rather than overwhelming stakeholders with technical minutiae, it focuses on the static structure of a system—what it is, what it contains, and how its parts relate. The model is structured into four levels of detail, often referred to as “Contextual Layers”:
- System Context: The big picture. It shows the software system and the people and other systems that interact with it.
- Containers: A high-level view of the runtime environment. It breaks the system down into major building blocks like web applications, mobile apps, or databases.
- Components: The internal structure of a container. It shows the logical grouping of functionality, such as a specific service or module.
- Code: The lowest level of abstraction, representing the actual class or interface structure.
While these four levels form the core, the C4 model also explicitly defines three supporting diagram types to handle specific architectural concerns that static views cannot cover:
- System Landscape: Shows how multiple software systems fit into an organizational or technical landscape.
- Dynamic: Describes how elements collaborate to complete a particular use case.
- Deployment: Illustrates where software runs in a specific environment.
When to Supplement: Answering Open Questions
A common pitfall in architecture documentation is creating a diagram for every possible view. The C4 philosophy suggests otherwise. The goal is to choose a focused view only when it answers a specific question that the existing C4 diagrams leave open.
Teams often supplement the core C4 views with standard UML notations. For example:
- Message Order: If the order of operations is critical, a UML Sequence Diagram is superior to a C4 Dynamic diagram.
- Process Logic: If the workflow involves complex decisions or parallel paths, a UML Activity Diagram is the best choice.
- Entity Lifecycle: To understand the states of an entity (e.g., an Order moving from “Pending” to “Shipped”), a UML State Machine Diagram is essential.
- Data Structure: To understand how records are related, an Entity-Relationship Diagram (ERD) is more direct than a class diagram.
The “Diagrams as Code” Workflow with VPasCode
To make architecture documentation maintainable, Visual Paradigm offers VPasCode, a browser-based workspace that supports “Diagrams as Code.” This approach treats diagrams as text, allowing them to be version-controlled, reviewed, and edited alongside your source code.
Step 1: Choose the Diagram and Scope
Before writing a single line of code, define the scope. Are you showing a single request, a full lifecycle, or a deployment environment? For instance, a dynamic view should scope the view to a single scenario, while a deployment diagram should name the environment (e.g., “Production”).
Step 2: Drafting with PlantUML
VPasCode supports PlantUML, a powerful scripting language for creating diagrams. You can write the code directly in the editor. For example, to create a System Landscape diagram, you might use the following syntax:
@startuml
!include https://static.visual-paradigm.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml
title System Landscape for Online Shop
Person(customer, "Customer", "Browses the shop")
Person(agent, "Support Agent", "Handles requests")
Boundary(shopBoundary, "Online Shop") {
System(shop, "Online Shop", "Web shop front end")
}
System_Ext(identity, "Customer Identity", "Authentication")
System_Ext(payment, "Payment Provider", "Transaction auth")
Rel(customer, shop, "Places orders", "HTTPS")
Rel(shop, payment, "Authorizes payments", "HTTPS")
@enduml
Step 3: Linking and Consistency
Supplementary diagrams must not become disconnected second models. To maintain consistency:
- Use consistent names: Match the system, container, and actor names used in your C4 views.
- Link related views: Embed the supplementary view in the same documentation section or add a reference beside the relevant C4 diagram.
- Clarify the scope: Explicitly state whether the view shows one request or a wider landscape.
Leveraging AI for Diagram Generation
Visual Paradigm’s VPasCode includes AI-assisted features to accelerate the drafting process. However, AI is a draft generator, not an architect. It can produce plausible-looking diagrams, but the architecture team remains responsible for validating the model’s accuracy.
To get the best results, use specific and bounded prompts. For example, when asking AI to generate a sequence diagram for a checkout process, you might prompt:
Create a PlantUML sequence diagram for one checkout attempt.
Use these participants: Web App, Orders API, Payment Adapter, Payment Provider, and Orders DB.
Include approved and declined outcomes.
Do not add retries, refunds, or other behavior unless specified.
This approach ensures the AI does not hallucinate behaviors that the system does not actually implement.
The Review Checklist
Before publishing any supplementary diagram, run it through this checklist to ensure it adds value rather than noise:
- Purpose: Does the title or surrounding text make the question clear?
- Scope: Is the system, environment, or scenario identified?
- Consistency: Do names match the C4 views and project terminology?
- Abstraction: Is this a system, container, domain, or database view?
- Readability: Can readers follow it without a dense tangle of elements?
- Maintenance: Is there a clear trigger for when this diagram needs to be updated?
Conclusion
The best supplementary diagram is not the most detailed one; it is the smallest accurate view that answers a real question. By combining the structured clarity of the C4 model with the flexibility of UML supplementary views and the efficiency of VPasCode’s code-based workflow, Agile EA teams can create architecture documentation that evolves with their software.