In this module, you will learn how to:
- Cluster related elements through
group
⌛ Estimated time to complete: 5 min
Structurizr provides the ability to gather related elements together. Not only it structures model section, but it will also improves downstream rendering by introducing boundary around grouped elements. Resulting layout is smarter, enforcing related elements locality.
You can only group siblings elements:
peopleandsoftware systemswithinmodelsectioncontainerswithin their parentsoftware systemcomponentswithin their parentcontainer
Dedicated snippet is provided via Cornifer:
group "name" {}
✏️ Split MILA softwareSystem in 2 groups, namely frontend & backend, by encompassing existing containers accordingly.
📙 REVEAL THE ANSWER
mila = softwareSystem "MILA" "Provides [...]" "" {
+ group "Frontend" {
spa = container "Web application" "" "" "" {}
mobile = container "Mobile application" "" "" "" {}
+ }
+ group "Backend" {
api = container "API application" "" "" "" {}
store = container "Materials store" "" "" "" {}
+ }
}✏️ Save your workspace, and refresh your browser.
Every view involving grouped containers has been updated to reflect grouping: a named boundary now properly delimits group.
📘 Completing this stage should lead to this final workspace.
Especially useful when software model is becoming complex (like micro-services architecture) or to highlight elements operating jointly, group allows to tidy up model section, while supporting layout engine and easing visual identification.
Software model is likely to operate in bigger ecosystem and you may wonder how you can avoid ending up with a monolith workspace. Next stage introduces a way to face such a situation.