A simple dynamic diagram can be useful when you want to show how elements in a static model collaborate at runtime to implement a user story, use case, feature, etc. This dynamic diagram is based upon a UML communication diagram (previously known as a "UML collaboration diagram"). It is similar to a UML sequence diagram although it allows a free-form arrangement of diagram elements with numbered interactions to indicate ordering.
Note: this page describes a feature that is not available to use with Structurizr's Free Plan. You can, however, render Dynamic diagrams using the PlantUMLWriter.
As an example, a Dynamic diagram describing the customer sign in process for a simplified, fictional Internet Banking System might look something like this. In summary, it shows the components involved in the sign in process, and the interactions between them.
See BigBankPlc.java for the code, and https://structurizr.com/share/36141#SignIn for the diagram.
In order to add a relationship between two elements to a dynamic view, that relationship must already exist between the two elements in the static view.
Showing parallel behaviour is also possible using the startParallelSequence()
and endParallelSequence()
methods on the DynamicView
class. See MicroservicesExample.java and https://structurizr.com/share/4241#CustomerUpdateEvent for an example.