Architecture as code

Klaus Lehner

  • CEO Catalysts
  • Architect
  • Coder

Architects should code

... because there are already enough ivory-tower-architects out there...

Architecture as code

Why?

Why not?
Because someone wants us to do some documentation...

But we hate UML

We hate documentation at all

So why architecture as code?
Because we are devs!
Because we can!

Because sys-admins have infrastructure as code!

Theory: The C4 Model

The C4 Model

Credits go to Simon Brown, check his great homepage

Basic idea is to create a common model of your software architecture, containing:

  • Context
  • Containers
  • Components
  • Code

along with their relationships amongst each other.

The C4 Model

...and then provide different views with different abstraction levels onto your model

The C4 Model

Unclear?

Check his homepage now!

So where is the code?

Structurizr

Simon Brown created Structurizr as a reference implementation of the C4 model

Structurizr is a publishing platform for software architecture diagrams and documentation based upon the C4 model; available as a free/paid cloud service and an on-premises installation

Structurizr

It contains clients in various languages (Java/Kotlin, .NET) and a Web-Platform for visualizating the views

So basically you code your architecture in Java/Kotlin or .NET, push it to the web, and visualize it there

Structurizr

Unclear?

Check his homepage now!

Java?

Spring!

Kotlin!

Code now!

and check https://github.com/Catalysts/cat-boot-structurizr-sample