This article focuses on designing a time series diagram in Visual Studio, which reads as follows:
- When to use time series diagrams
- Timing Diagram Elements Introduction
- Conditions, the use of loops in time series diagrams
- Generate sequence diagrams directly from code
first, when to use time series diagram
When you want to see the behavior of several objects within a single use case, you should use time series diagrams, which are used to demonstrate collaboration between objects (Martin Fowler).
second, time series diagram element Introduction
First, a diagram.
The basic elements of a time series diagram are shown: Actor, Lifeline, message, return, self-invocation.
One thing to note is that the participant people:people, this is represented by the class, and the format is Name:class. If you use a class to represent the contributor name can be omitted, but the colon must be persisted. If you see someone drawing a time series diagram and find that the participant contains a colon, it means that this is a class. The other may be an ordinary abstract participant.
Iii. the use of cycles and conditions in time series diagrams1. Conditionsbusiness scenarios, users to query their own bank card consumption records, first access to bankservice,bankservice in the receipt of query requests will be accessed Securityservice to verify the identity of the user, if the identity of the legitimate directly query consumption records, otherwise, directly returned.
By right-clicking on the query message line-surround with-alt to complete the operation
2. Circulation
Business scenario, the user may have multiple cards and need to access multiple dataservice for querying.
Complete the operation by right-clicking on the-surround with-loop on the query message line
Iv. Generating sequence diagrams directly from code
Sample code
How to generate: Right-click on a method.
Generated time series diagram
It's very handy to generate time-series diagrams from code. This facilitates the interpretation of your code logic like outsiders, but only if the code is to be introduced, and the encapsulation is complete.
These are the most common areas of the time series used in their work. VS, it's very handy to do it.
UML Design Via Visual studio-sequence Diagram