forked from structurizr/dsl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51c816d
commit e4acd9b
Showing
6 changed files
with
91 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Dynamic view | ||
|
||
A [dynamic view](https://c4model.com/#DynamicDiagram) allows you to show a subset of the elements in a model, and the relationships between them, in order to describe how a particular use case/story/feature works. Dynamic views show ordered __instances__ of relationships, therefore reducing the number of relationships you need to define in the static model - see [Modelling multiple relationships](https://dev.to/simonbrown/modelling-multiple-relationships-51bf) for more. | ||
|
||
``` | ||
workspace { | ||
model { | ||
customer = person "Customer" | ||
onlineBookStore = softwareSystem "Online book store" { | ||
webapp = container "Web Application" | ||
database = container "Database" | ||
} | ||
customer -> webapp "Browses and makes purchases using" | ||
webapp -> database "Reads from and writes to" | ||
} | ||
views { | ||
container onlineBookStore { | ||
include * | ||
autoLayout lr | ||
} | ||
dynamic onlineBookStore { | ||
title "Request past orders feature" | ||
customer -> webapp "Requests past orders from" | ||
webapp -> database "Queries for orders using" | ||
autoLayout lr | ||
} | ||
dynamic onlineBookStore { | ||
title "Browse top 20 books feature" | ||
customer -> webapp "Requests the top 20 books from" | ||
webapp -> database "Queries the top 20 books using" | ||
autoLayout lr | ||
} | ||
} | ||
} | ||
``` | ||
|
||
This DSL defines three views: | ||
|
||
1. A container view showing the user and containers - notice how the relationship between the user and the web application is quite general ("Browses and makes purchases using"). | ||
2. A dynamic view for the "request past orders" feature. | ||
2. A dynamic view for the "browse top 20 books" feature. | ||
|
||
[![](example-1.png)](http://structurizr.com/dsl?src=https://raw.githubusercontent.com/structurizr/dsl/master/docs/cookbook/dynamic-view/example-1.dsl) | ||
|
||
Dynamic views can be rendered using the Structurizr cloud service/on-premises installation or exported to a number of other formats via the [Structurizr CLI export command](https://github.com/structurizr/cli/blob/master/docs/export.md). | ||
|
||
## Links | ||
|
||
- [DSL language reference - dynamic](https://github.com/structurizr/dsl/blob/master/docs/language-reference.md#dynamic-view) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
workspace { | ||
|
||
model { | ||
customer = person "Customer" | ||
onlineBookStore = softwareSystem "Online book store" { | ||
webapp = container "Web Application" | ||
database = container "Database" | ||
} | ||
|
||
customer -> webapp "Browses and makes purchases using" | ||
webapp -> database "Reads from and writes to" | ||
} | ||
|
||
views { | ||
container onlineBookStore { | ||
include * | ||
autoLayout lr | ||
} | ||
|
||
dynamic onlineBookStore { | ||
title "Request past orders feature" | ||
customer -> webapp "Requests past orders from" | ||
webapp -> database "Queries for orders using" | ||
autoLayout lr | ||
} | ||
|
||
dynamic onlineBookStore { | ||
title "Browse top 20 books feature" | ||
customer -> webapp "Requests the top 20 books from" | ||
webapp -> database "Queries the top 20 books using" | ||
autoLayout lr | ||
} | ||
} | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.