Please can anyone suggest any improvements or corrections in the attached sequence diagram. The diagram is regarding student registration and search book.
问题:
回答1:
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.
回答2:
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.