0

Please can anyone suggest any improvements or corrections in the attached sequence diagram. The diagram is regarding student registration and search book.Sign up sequence diagram

search book sequence diagram

juelee
  • 47
  • 1
  • 7
  • 1
    For the first diagram, you certainly want a `Account` class, after you signup, the dashed arrow should go to `Account` class, which mean create a new account.I will recommend you do a bit more requirement analysis before you draw the sequence diagram. Apparently, there should be more classes rather than Database and GUI only. – Timothy Leung Nov 03 '14 at 06:25
  • 1
    Sequence diagrams are not limited to modeling behavior of objects in class diagrams. They are also often used to model use case scenarios. A path through a use case may or may not be modeled with actual objects from the developed solution. – BobRodes Nov 03 '14 at 15:57

2 Answers2

2

You should not think on classes creation being in sequence diagram. Make a class diagram, maybe an object diagram, and after that make your sequence diagram with instances of created classes as timelines. Add a class diagram here, without it it is impossible to answer your questions.

As is, you are working with elements of use case diagram (agents), not classes. It is acceptable, too. But then you should create a component diagram and use components as timelines.

So, your problem is that you have minimally one diagram less than you should. A whole diagram, not a block in one.

So, for this task you can use the following sets of diagrams:

The fullest one: Use Case + State + Component + Communication + Sequence + Class + Object + Composite Structure

The wide refactoring of your diagram: Component + Sequence + Class + Object

The minimalistic refactoring: Sequence + Class

Of course, you can make more than one diagram of any kind mentioned. Also, some diagrams if they are small, can be combined in one - UC+State, for example.

The normal process is creation one diagram after another, returning to the previous ones. Behaviour/structure diagrams of the same level can be created simultaneously. If you have problems with some thought on one diagram, try to express it on another one.

Yes, you can do a sequence diagram for every action of use case or even of Activity/communication diagram. But if your seniors won't make you to do it, it is enough to create only these diagrams that are needed for better understanding of the process.

Gangnus
  • 24,044
  • 16
  • 90
  • 149
  • sorry but I did not understand by minimally one diagram less. We can create more than one sequence diagrams right? – juelee Nov 03 '14 at 17:50
  • It would be very nice of you (and celebration of your 8000rep for the rest of us, mortals) if you'd add the minimal set of diagrams (pictures) that would be, in your opinion, just enough for this, probably very typical homework, example of the never-ending story of a student and the library and a librarian(s) – xmojmr Nov 03 '14 at 19:52
  • 1
    @xmojmr 8k-3k difference is negligible. But thanks. As for pictures, sorry, it is HIS work. I have added the possible sets. Hezky den. – Gangnus Nov 04 '14 at 11:30
  • @juelee Edited. Need more explanation? – Gangnus Nov 04 '14 at 11:31
-1

Sequence diagrams, in the context you're using them, should be modeling a single path through a use case. Think of it this way: a use case diagram models the different things that a system does and who interacts with it. An activity diagram models out the behavior of a single use case. A sequence diagram models out a single path through a use case (in other words, a single path through an activity diagram that models a use case).

In the case of your above sequence diagrams, it looks like you have two use cases: "Login" and "Create Account". Create account extends login. I would suggest that you first document in detail what each use case does (google "Use case narrative" for more information). Use an activity diagram if it helps clarify the narrative. Then look at the individual paths through the use case (google "use case scenario" for more information), using sequence diagrams to help clarify the scenarios as necessary.

BobRodes
  • 5,990
  • 2
  • 24
  • 26
  • so what changes are expected in the above sequence diagrams? And the above sequence diagrams are for Student registration and search book. – juelee Nov 03 '14 at 17:52
  • What did you mean by "_..in the **context**..single path through a use case.._"? Sequence diagrams can model quite complex scenarios with many actors and with all those `combined fragments` and `interaction use`, like this one: http://www.uml-diagrams.org/sequence-diagrams-examples.html#pluck-comments Why would you recommend using the simplified modeling 1 sequence diagram per 1 use case in this case? – xmojmr Nov 03 '14 at 19:58
  • 2
    @xmojmr: I respectfully request that you read my post over again, with the clarification that a "use case scenario" is a "single path through a use case", and that a use case consists of multiple scenarios. You will see that I don't recommend one sequence diagram per one use case. – BobRodes Nov 04 '14 at 18:58
  • @juelee: I can't recommend any changes to your sequence diagrams, since I'm unaware of the context producing them. Again, the drill down is use cases, activity diagrams, sequence diagrams. What use case scenarios are you diagramming? – BobRodes Nov 04 '14 at 19:01
  • @BobRodes I have use cases like Login, register user, add book, delete book, view user profile, etc – juelee Nov 05 '14 at 18:46
  • All right. With respect, please note that your post does not answer my question, as you appear to be confusing use cases with use case scenarios. I will ask you to read and attempt to understand the last three sentences in my answer, as understanding them is important to implementing the suggestions given in response to your request for suggestions. If you have trouble, please post back with specific questions. – BobRodes Nov 06 '14 at 21:39