
In the fast-paced world of Agile Enterprise Architecture, clarity is currency. The old adage “a picture is worth a thousand words” holds true, but only if the picture answers the right question. For modern teams, the C4 model has emerged as the gold standard for describing software architecture. However, maintaining these diagrams in a vacuum is a recipe for technical debt. This tutorial explores a powerful, modern workflow: combining the structural clarity of the C4 model with the agility of “Diagrams as Code” using VPasCode and AI assistance.
The Core Philosophy: Context Over Detail
The C4 model simplifies software architecture into a hierarchy of four levels, moving from the broad to the specific. It is not just about drawing boxes; it is about communicating structure. The model defines a small set of structural views: System Context, Containers, Components, and Code. Its primary focus is the static structure—what the system is, what it contains, and how its parts relate.
While C4 is robust, it is intentionally limited to static structures. In practice, Agile teams often find that a static snapshot is not enough to explain complex behaviors. This is where supplementary diagrams come into play. The goal is not to create a diagram for every possible view, but to choose a focused view when it answers a question the existing C4 diagrams leave open.
Step 1: Choosing the Right Supplementary View
Before reaching for a tool, you must start with the question. A useful decision guide helps teams select the right notation for the specific architectural concern.
- How do several systems fit into an organizational landscape? Use a C4 System Landscape diagram.
- Which system elements collaborate in a use case? Use a C4 Dynamic Diagram.
- What messages pass between participants, and in what order? Use a UML Sequence Diagram.
- What are the process steps, decisions, or parallel paths? Use a UML Activity Diagram.
- What states can an entity enter, and what triggers transitions? Use a UML State Machine Diagram.
- What data is persisted and how are records related? Use an Entity-Relationship Diagram (ERD).
Step 2: The “Diagrams as Code” Workflow
Gone are the days of dragging and dropping shapes on a canvas that becomes unmanageable. Modern teams utilize “Diagrams as Code” to keep architecture documentation version-controlled, reviewable, and maintainable. PlantUML is the industry-standard syntax for this, allowing developers to write text that renders into complex diagrams.
For this workflow, we utilize VPasCode, a browser-based workspace from Visual Paradigm. It supports PlantUML natively, providing a code editor with a rendered preview. This allows teams to draft, inspect, and refine diagrams directly in the browser, leveraging AI assistance to accelerate the drafting process.
Example: Drafting a Sequence Diagram in VPasCode
When you need to trace message order or request/response behavior, a sequence diagram is the best choice. Below is a practical example of how you might draft a “Checkout Sequence” using PlantUML syntax within the VPasCode environment.
title Online Shop — Checkout Sequence
actor Customer
participant "Web App" as Web
participant "Orders API" as Orders
participant "Payment Adapter" as Payments
participant "Payment Provider" as Provider
database "Orders DB" as DB
Customer -> Web : Submit checkout
Web -> Orders : createOrder(cart)
Orders -> Payments : authorize(amount)
Payments -> Provider : authorize(amount)
Provider --> Payments : authorization result
alt Payment approved
Payments --> Orders : approved
Orders -> DB : save(order, CONFIRMED)
DB --> Orders : saved
Orders --> Web : confirmation
Web --> Customer : Show confirmation
else Payment declined
Payments --> Orders : declined
Orders -> DB : save(order, PAYMENT_FAILED)
Orders --> Web : payment issue
Web --> Customer : Show payment issue
end
Step 3: Leveraging AI for Architecture Drafting
Visual Paradigm integrates AI assistance directly into the VPasCode workflow. However, it is crucial to treat AI output as a draft. While AI can produce plausible-looking diagrams, the architecture team remains responsible for validating the model.
To get the best results, your AI prompts must be specific and bounded. Avoid vague requests like “Draw a checkout process.” Instead, specify the diagram type, the participants, and the constraints.
Useful AI 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."
After the AI generates the draft, you must render and inspect the code to ensure it is valid and legible. Finally, verify the meaning with your team to confirm that names, relationships, and transitions reflect the actual design.
Step 4: Integrating C4 and Supplementary Views
A robust architecture documentation set blends the high-level C4 views with detailed supplementary diagrams. Here is how they integrate in a real-world scenario:
- System Landscape: Use this to show how multiple software systems (like CRM, Payment Providers, and Analytics) fit into the broader organizational scope.
- Dynamic Diagram: Use this for a concise architectural interaction among elements, showing which components collaborate in a use case.
- Deployment Diagram: Use this to describe where software runs, mapping software-system instances to deployment nodes (e.g., Cloud Region, Web Tier).
- State Machine: Use this to model the lifecycle of a single entity, such as an Order moving from PendingPayment to Confirmed or PaymentFailed.
- Entity-Relationship Diagram: Use this when the question is specifically about persisted data, tables, keys, and data relationships.
Conclusion: The Smallest Accurate View
The best supplementary diagram is not the most detailed one; it is the smallest accurate view that answers a real question and remains connected to the rest of the architecture documentation. By combining the C4 model’s structural clarity with the agility of VPasCode and the speed of AI, Agile EA teams can create documentation that evolves with their software, ensuring clarity and correctness at every step.
