Structurizr for Java
This GitHub repository is primarily a client library for Structurizr, a web-based publishing platform for software architecture models based upon the C4 model. It can also be used to create software architecture diagrams that can be rendered with tools such as PlantUML, Graphviz and WebSequenceDiagrams.
In essence, Structurizr for Java is an implementation of an executable architecture description language; a domain-specific language to describe software architecture, using code. The key benefit of using code to create a software architecture model is that you can use the static analysis and reflection features of Java to help you extract components from the codebase you are modelling. Integration of this tooling with your continuous integration/build process helps your software architecture diagrams stay up to date.
A quick example
As an example, the following Java code can be used to create a software architecture model and an associated view that describes a user using a software system.
public static void main(String[] args) throws Exception {
Workspace workspace = new Workspace("Getting Started", "This is a model of my software system.");
Model model = workspace.getModel();
Person user = model.addPerson("User", "A user of my software system.");
SoftwareSystem softwareSystem = model.addSoftwareSystem("Software System", "My software system.");
user.uses(softwareSystem, "Uses");
ViewSet views = workspace.getViews();
SystemContextView contextView = views.createSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram.");
contextView.addAllSoftwareSystems();
contextView.addAllPeople();
}
The view can then be exported to be visualised in a number of different ways; e.g. PlantUML, Structurizr and Graphviz:
Table of contents
- Introduction
- Getting started
- About Structurizr and how it compares to other tooling
- Why use code?
- Basic concepts (workspaces, models, views and documentation)
- C4 model
- Examples
- Binaries
- API client
- Usage patterns
- Model
- Views
- Documentation
- Extracting software architecture information from code
- Exporting and visualising with other tools
- Other
- Related projects
- java-quickstart: A simple starting point for using Structurizr for Java
- structurizr-kotlin: An extension for Structurizr that lets you create your models in a fluent way.
- structurizr-spring-boot: A way to apply dependency management to help modularise Structurizr code.
- structurizr-groovy: An initial version of a Groovy wrapper around Structurizr for Java.
- structurizr-dotnet: Structurizr for .NET
- changelog