OMG are you still using Rational Rose?

application architecture   architecture documentation   architecting  

Recently, I wrote the first in a series of articles about how to understand and document an architecture. One amusing comment on the post was “OMG are you still using Rational Rose?”. The answer is, of course, no. I’m actually using PlantUML.

The original goal of this article was to simply explain why I use PlantUML. But it’s expanded to cover the following topics:

  • Architecture is elements and relations
  • Architecture is multi-dimensional
  • Architecture documentation != diagrams
  • Documenting dynamic behavior is essential
  • Why UML and PlantUML?
  • Use the visual notation and tooling that works for you

Architecture is elements and relations

Len Bass and colleagues at the Software Engineering Institute define software architecture as follows:

The software architecture of a computing system is the set of structures needed to reason about the system, which comprise software elements, relations among them, and properties of both.

Superficially, it sounds like an architecture is a collection of boxes and lines 😀. But in reality, it’s a complex multi-dimensional model.

Architecture is multi-dimensional

Of course, an application’s architecture is a bit more complicated than that. Architecture is multi-dimensional and is described by a set of views, each of which is a collection of elements, relations and their properties.

For example, as I discuss in Using scenarios to reinvigorate your microservice architecture I like to use the following views to document an architecture:

  • System context - the black box model of the application.
  • Logical - consists of elements, such as classes and packages, and the relations between them, such as class X is subclass of Y and class X is part of package Y
  • Implementation - consists of elements, such as modules (e.g. JAR files) and components (e.g. executable JAR files), and the relations between them such as module X is part of component Y
  • Deployment - consists of infrastructure and cloud resources, such as Kubernetes deployments, pods, etc, and AWS resources, such RDS instances.
  • Repository/Deployment pipeline - the elements that comprise the code repositories and the deployment pipeline

Architecture documentation != diagrams

There’s a tendency to think that architecture documentation is merely a collection of diagrams. In reality a view’s documentation is some combination of diagrams and text. And, in some cases, it might be purely textual. The goal is communicate the view’s model clearly.

For example, here’s the textual description of the FTGO application’s system context:

The explanation typically describes each element and relation. It might also provide a rationale for the design, e.g. an architecture decision record.

Documenting dynamic behavior is essential

It’s insufficient to merely describe a view’s static structure. You must describe a view’s dynamic behavior, which is how its elements collaborate during a scenario. This is the +1 of the famous 4+1 view model of architecture. Since the scenarios are derived from user stories, documenting the dynamic behavior using scenarios connects the architectural elements to the requirements. A continuation of the outside-in, user-goal focussed approach to software architecture documentation.

For example, a key user story in the FTGO application is Place Order. This user story has one or more key scenarios. These scenarios would most likely be part of the documentation for the system context, logical, implementation and deployment views. The system context documentation would describe how the consumer (actor), the FTGO application, and the external services would collaborate to create an order. Similarly, the logical view’s documentation would describe how the classes collaborate. Later articles in the series, will describe how document diagram behavior in more detail.

Why UML?

Now that I’ve discussed how application’s architecture is described by a set of views, each of which consists of diagrams and/or text, I can now talk about UML. An architecture diagram must clearly communicate what types of the elements and relations that it depicts. Otherwise, there is a danger that a diagram is a confusing collection of boxes and lines, A good way to provide clarity is to use a ‘standardized’ notation, which is why I use a subset of UML. Also, it’s often helpful if a diagram also has legend.

Why PlantUML?

There are a few different ways to create a UML-based architecture diagram:

  • Specialized UML tools, such as Rational Rose
  • General purpose drawing tools, such as Omnigraffle
  • Text-based diagram generator, such as PlantUML and Mermaid

These days I primarily use PlantUML. While it might not produce the most beautiful diagrams, PlantUML makes creating diagrams quick and easy. And, since it’s text based, the diagram files can be stored in Git.

For example, I defined this diagram:

using the following PlantUML file ftgo-system-context.txt:

@startuml
hide empty members

left to right direction

component FTGO_Application
component Twilio
component Stripe
component AWS_SES

actor Courier
actor Consumer
actor Restaurant

Courier --> FTGO_Application
Consumer --> FTGO_Application
Restaurant --> FTGO_Application

FTGO_Application --> Twilio
FTGO_Application --> AWS_SES
FTGO_Application --> Stripe

@enduml

Creating images from PlantUML files

You can easily embed a PlantUML diagram in an AsciiDoc document by using Asciidoctor Diagram:

plantuml::./ftgo-system-context.txt[]

Given that architecture documentation is more than just diagrams, I find this Asciidoctor integration especially useful.

Alternatively, you can create an image file by running PlantUML directly. For example, I’ve packaged PlantUML and its dependencies as a Docker image.

PlantUML also has many other integrations. See the PlantUML website the details.

Use the visual notation and tooling that works for you

I’ve described why I use UML and PlantUML. But there are lots of other options. You should use whatever works for you.

It’s important to remember, however, that:

  • Architecture is elements and relations
  • Architecture is multi-dimensional
  • Architecture documentation != diagrams
  • Documenting dynamic behavior is essential

Need help adopting microservices?

I provide consulting and training.


application architecture   architecture documentation   architecting  


Copyright © 2024 Chris Richardson • All rights reserved • Supported by Kong.

About Microservices.io

Microservices.io is brought to you by Chris Richardson. Experienced software architect, author of POJOs in Action, the creator of the original CloudFoundry.com, and the author of Microservices patterns.

ASK CHRIS

?

Got a question about microservices?

Fill in this form. If I can, I'll write a blog post that answers your question.

NEED HELP?

I help organizations improve agility and competitiveness through better software architecture.

Learn more about my consulting engagements, and training workshops.

LEARN about microservices

Chris offers numerous other resources for learning the microservice architecture.

Get the book: Microservices Patterns

Read Chris Richardson's book:

Example microservices applications

Want to see an example? Check out Chris Richardson's example applications. See code

Virtual bootcamp: Distributed data patterns in a microservice architecture

My virtual bootcamp, distributed data patterns in a microservice architecture, is now open for enrollment!

It covers the key distributed data management patterns including Saga, API Composition, and CQRS.

It consists of video lectures, code labs, and a weekly ask-me-anything video conference repeated in multiple timezones.

The regular price is $395/person but use coupon NPXJKULI to sign up for $95 (valid until December 25th, 2024). There are deeper discounts for buying multiple seats.

Learn more

Learn how to create a service template and microservice chassis

Take a look at my Manning LiveProject that teaches you how to develop a service template and microservice chassis.

Signup for the newsletter


BUILD microservices

Ready to start using the microservice architecture?

Consulting services

Engage Chris to create a microservices adoption roadmap and help you define your microservice architecture,


The Eventuate platform

Use the Eventuate.io platform to tackle distributed data management challenges in your microservices architecture.

Eventuate is Chris's latest startup. It makes it easy to use the Saga pattern to manage transactions and the CQRS pattern to implement queries.


Join the microservices google group