I recently read the book 'UML Distilled' and found the sequence diagrams very useful. My question is that can we show 'data flow' as well on a sequence diagram? This is my first time on sequence diagrams.
Nice to see some examples if any.
Software Engineering Stack Exchange is a question and answer site for professionals, academics, and students working within the systems development life cycle. It only takes a minute to sign up.Sign up to join this community
The data is included as the parameters within the messages. For example the instance buyersBank of the Bank class takes an accountNumber and returns the balance for the buyersBank instance.
I have highlighed the key points from the OMG specification. pg 491-494
<messageident> ::= ([<attribute> ‘=’] <signal-or-operation-name> [‘(‘ [<argument>[‘,’<argument>]* ‘)’] [‘:’ <return-value>]) | ‘*’
Examples of syntax:
mymessage(14, - , 3.14, “hello”) // second argument is undefined v=mymsg(16, variab):96 // this is a reply message carrying the return value 96 assigning it to v mymsg(myint=16) // the input parameter ‘myint’ is given the argument value 16
v = attribute mymessage = signal-or-operation-name (16,vairab) = arguments :96 = return value
Visual Studio 2010 Ultimate will auto-generate sequence diagrams. You can reverse engineer existing methods by right-clicking and selecting auto-generate sequence diagram.