开发者

Drawing Sequence Diagrams [closed]

开发者 https://www.devze.com 2023-03-13 18:32 出处:网络
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines guidelines. It is not currently accepting answers.
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 8 years ago.

开发者_开发百科 Improve this question

I'm looking for an easy language/command line utility to draw sequence and timing diagrams (could be 2 different tools). I've already found Mscgen for sequence diagram drawing and looks pretty good, but I'm studying other possibilities.

Thanks


PlantUML. http://plantuml.sourceforge.net/sequence.html

PlantUML is used to draw UML diagram, using a simple and human readable text description.

The generated images can then be used without any reference to the GPL/LGPL/ASL/EPL/MIT license. It is not even necessary to stipulate that they have been generated with PlantUML, although this will be appreciate by PlantUML team.

In my experience it has been easy to use and it produces nice looking diagrams. I can't recommend it more highly.

Output file types:

-tsvg     To generate images using SVG format
-teps     To generate images using EPS format
-txmi     To generate XMI file for class diagram
-thtml    To generate HTML files for class diagram
-ttxt     To generate images with ASCII art
-tutxt    To generate images with ASCII art using Unicode characters

Here is an example showing how to create a simple sequence diagram.

Drawing Sequence Diagrams [closed]

@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml

You can also create more detailed diagrams by using lifeline activation and destruction:

Drawing Sequence Diagrams [closed]

@startuml
participant User

User -> A: DoWork
activate A

A -> B: << createRequest >>
activate B

B -> C: DoWork
activate C
C --> B: WorkDone
destroy C

B --> A: RequestCreated
deactivate B

A -> User: Done
deactivate A

@enduml


The best software I've found and I usually use to make sequence diagrams from plain text is SDEdit. It's a Java tool, so you can use it in any operating system. And it's free software!

With this tool, you write the following:

#![SD ticket order]
ext:External[pe]
user:Actor
/order:Order[x]
db:TicketDB
acc:Account

ext:user.order a ticket!
user:order.new()
order:return=db.reserve(date,count)
db:return=acc.debit(cost)
acc:return=db.bonus(date,count)

to obtain this:

Drawing Sequence Diagrams [closed]


For sequence diagrams, you may take a look at websequencediagrams - it creates nice looking diagrams and has a lot of functionalities (examples page). It's not a command line utility, but it does have its web-API.

ditaa creates nice looking diagrams from ascii source. Written in java, it can be called on the command line to convert ascii text to diagrams.


Another sequence diagram tool is http://sequencediagram.org where it's possible to draw the diagram to generate the script and script to get the diagram at the same time.

So, it's good for large diagrams where you normally lose track of where you are in the script.

Drawing Sequence Diagrams [closed]


update: probably mermaid is good enough, you can use it in various markdown editors, such as hackmd. Otherwise, for print, see my origina answer below.


This answers is maybe not exactly what you had in mind, so let me shortly give a context.

Over the years I've come to appreciate literate programming as a super nice way to write quality software and keep that code comprehensible. Maybe the only way... In any case, sequence diagrams, being visual, nicely complement code and writing. This facilitates understanding.

LaTeX / PGF / pgf-umlsd / noweb

So for this purpose, LaTeX + pgf-umlsd can create very good looking diagrams. They are specified semantically, like most other tools, meaning you say what sequence you what, not how it should look. The program computes the right picture.

So this LaTeX code

\documentclass{article}
\usepackage{tikz}
\usepackage{pgf-umlsd}

\begin{document}
\begin{sequencediagram}
  \newthread{t}{:Thread}
  \newinst[1]{i}{:Instance}
  \begin{sdblock}{Block}{description}
     \begin{call}{t}{function()}{i}{}
  \end{call}
  \end{sdblock}
\end{sequencediagram}
\end{document}

creates this picture (of course using the fonts of the rest of your document, etc.):

Drawing Sequence Diagrams [closed]

In the LaTeX source the relevant bits of executable code are just below the diagram, keeping things together. I use noweb (site, docs) to get the runnable code or the source for the article.

HTH.


GenMyModel now supports sequence diagrams.

Drawing Sequence Diagrams [closed]


EventStudio System Designer 5 might work for you. It generates sequence diagrams from text based input. Also handles multiple scenarios.


For sequence diagrams you may also want to look at Visual Paradigm, quite a powerful tool.


For sequence diagrams, you also might want to look at UMLGraph.

Update 2018-08-24: web page seems to have moved to here.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号