Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the correct usage of UML sequence diagrams? Should they contain objects of View classes or DB classes? Or should they modeled in a more generalized fashion? Or is this completely arbitrary?

share|improve this question

It should contain the objects of interest in the interaction.

Like any type of documentation, it should focus on what you are trying to document. If you are documenting the DB interaction, you should have the DB classes involved. If not, you shouldn't.

share|improve this answer
Okay. So what should I do if I draw a diagram for "User logging" and I want to point out displaying a login form? Should I return directly from an User class the message, or return the form from the UserView class? – deem Apr 28 '12 at 20:18
@daroPL - What are you trying to document for "User logging"? Validation? Interactions with the database? Who is the audience for this? – Oded Apr 28 '12 at 20:19
I based on the use cases, an actor is an User. At first the User run the Login option, next the System (an User or UserView class) displays the login form, after that the User input the data. System verify the data by checking it in the database. Finally, it displays a message "You are logged now". – deem Apr 28 '12 at 20:27
Maybe it should be like "User (an actor) <-> User (object) <-> DB, where DB is some kind of generalized object, which consist of different Model Classes within real code? – deem Apr 28 '12 at 20:46
@daroPL - It really depends on who the audience of the document is and what you are trying to convey to them. – Oded Apr 28 '12 at 21:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.