Wednesday, 6 May 2015

UML: authoring simple sequence diagrams

I had specific criteria for a UML sequence diagram generator:

  • Text-sourced
  • Simple
  • Off-line
  • Linux

seqdiag fits the bill. There is an interactive shell if you want to try it out before installing.

Installing seqdiag on Ubuntu

My Linux distro report:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty

Commands to install seqdiag:

sudo apt-get install python-setuptools
sudo easy_install seqdiag

See the setup documentation for more details.

Sample seqdiag diagram

Here is a simple sequence diagram script tcp.diag:

seqdiag {
  client -> server [label = "SYN"];
  client <- server [label = "SYN+ACK"];
  client -> server [label = "ACK"];

By default seqdiag turns the file into a PNG file:

$ seqdiag tcp.diag 
$ ls
tcp.diag  tcp.png

See the seqdiag sample diagrams page for more detailed examples.

No comments:

Post a Comment

All comments are moderated