![]() Messages can be complete, lost or found synchronous or asynchronous call or signal. Boundary, control and entity elements from robustness diagrams can also own lifelines. This will usually be the case if the sequence diagram is owned by a use case. Sometimes a sequence diagram will have a lifeline with an actor element symbol at its head. If its name is "self", that indicates that the lifeline represents the classifier which owns the sequence diagram. A lifeline will usually have a rectangle containing its object name. Sequence diagrams are not intended for showing complex procedural logic.Ī lifeline represents an individual participant in a sequence diagram. Sequence diagrams are good at showing which objects communicate with which other objects and what messages trigger those communications. If you'd like to learn more and see a few features I didn't cover, I recommend you check out Mermaid.js' sequence diagram documentation.Īnd finally, I'm not done exploring what modern software engineers can do with Mermaid.js so stay tuned for more content! Mermaid.UML 2 Tutorial - Sequence Diagram Sequence DiagramsĪ sequence diagram is a form of interaction diagram which shows objects as lifelines running down the page, with their interactions over time represented as messages drawn as arrows from the source lifeline to the target lifeline. Ultimately, I think Mermaid.js Sequence Diagrams are a good strategic tool for diagramming complex interactions or communicating complex concepts in a visual way in your documentation. Personally, I find Mermaid.js diagrams so convenient to use that I now find myself making sequence diagrams where I normally wouldn't have before due to the time and frustration required to build one. While sequence diagrams aren't necessarily beginner friendly, working with Mermaid.js sequence diagrams is exponentially less painful than trying to control a diagramming tool to generate and maintain these diagrams. Ultimately, I don't think I like this shorthand and instead prefer to use the activate / deactivate syntax for more readable sequence diagrams, but the option is there for you if you want it. Let's start with a simple sequence diagram representing a message from the client to the server and the server's response back.Įnter fullscreen mode Exit fullscreen mode If you're curious about this, however, I do have an article and video on understanding JWT authentication. However, the focus of the article's text will be on the diagrams themselves, not the process of JWT authentication. Over the course of this article, we'll create and expand a sequence diagram to explain JSON Web Token (JWT) authentication. ![]() If you're curious about sequence diagrams in general, a good starting point might be Visual Paradigm's Guide to Sequence Diagrams. This can help explain complex logic and interactions with a technical diagram and identify areas of confusion or misunderstanding. Sequence diagrams represent systems and individuals as vertical columns and messages between these parts as horizontal lines that move across the various lanes to show how data flows between different pieces of the system. Mermaid.js is available in a variety of tools, but I most frequently use it in GitHub markdown files and in Polyglot Notebooks.įor those of you who haven't been exposed, sequence diagrams describe a series of messages in a sequence between different objects. It also means that the diagram source is easily version-controlled and anyone on your team can modify it without special tooling or licenses. This means your time is focused on actually writing the interaction logic instead of generating a visual. ![]() With Mermaid.js you can write a few lines of text and use its JavaScript library to generate a professional sequence diagram like the one below: Mermaid.js is the solution I needed 20 years ago. I distinctly remember working on sequence diagrams in my undergraduate computer science education and having so many issues trying to get the various boxes and arrows to look standard, rearrange shapes as I needed to expand the diagram, and generally focusing on anything but the logic the diagrams intended to create. Previously I've shown how Mermaid.js allows you to create entity relationship diagrams and class diagrams, but in this article we'll cover a far more complex diagram: the sequence diagram. I've been really enjoying seeing how Mermaid.js lets you generate technical diagrams from simple markdown.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |