Suppose I have code like
user = AuthHandler.getLoggedInUser()
user.setName(name)
UserDAO.update(user)
How will the sequence diagram look like?
I did
Is it correct? the user/userDAO part?
Sequence Diagrams doesn't require much detail about the object that is returned.
When an operation is performed in an object / class (rectangles), then, a returning dotted arrow should go back to the line and object where it came from.
If a value is returned (wheter an object or a simple type variable), its identifier should appear over the returning arrow.
Optional "return" tags can appear over the arrows that doesn't explicit return a value.
There are several tutorials on the web, I recommend:
http://www.agilemodeling.com/essays/umlDiagrams.htm
EDIT:
In Sequence Diagrams, The returned object type is indicated by an identifier in the text in each box, such as "user: User" or ":UserDAO".
Then, a complementary class diagram or object diagram, based on the given objects, can provide additional information to the actual Sequence Diagram, using the same class identifier or object identifier, example: "User" or "UserDAO".
Do not confuse the class identifier, with the instance identifier.
Note that in the given figure, some boxes skip the specific object instance identifier, or replace it with an asterisk character.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With