In: Computer Science
1. Develop a Detailed Sequence Diagram
2. Explain how these diagrams (Detailed Sequence Diagram and a use case diagram) would help in developing and implementing the new system.
Here is the scenario:
MoveYourBooksNow.com is a book exchange that does business entirely on the Internet. The company acts as a clearinghouse for buyers and sellers of used books.
To offer books for sale, a person must register with MoveYourBooks. The person must provide a current physi- cal address and telephone number as well as a current e-mail address. The system maintains an open account for this person. Access to the system as a seller is through a secure, authenticated portal.
A seller can list books on the system through a special Internet form. Information required includes all the perti- nent information about the book, its category, its general condition, and the asking price. A seller may list as many books as desired. The system maintains an index of all books in the system so buyers can use the search engine to search for books. The search engine allows searches by title, author, category, and keyword.
People who want to buy books come to the site and search for the books they want. When they decide to buy, they must open an account with a credit card to pay for the books. The system maintains all this information on secure servers.
When a request to purchase is made and the payment is sent, TheMoveYourBooks.com sends an e-mail notice to the seller of the book. It also marks the book as sold. The system maintains an open order until it receives notice that the book has been shipped. After the seller receives notice that a listed book has been sold, the seller must notify the buyer via e-mail within 48 hours. Shipment of the order must be made within 24 hours of the seller sending the noti- fication e-mail. The seller sends a notification to the buyer and TheMoveYourBooks.com when the shipment is made.
After receiving notice of shipment, TheMoveYour- Books.com maintains the order in shipped status. At the end of each month, a check is mailed to each seller for the book orders that have been in shipped status for 30 days. The 30-day waiting period allows the buyer to notify The- MoveYourBooks.com if the shipment doesn’t arrive for some reason or if the book isn’t in the same condition as advertised.
If they want, buyers can enter a service code for the seller. The service code is an indication of how well the seller is servicing book purchases. Some sellers are very active and use TheMoveYourBooks.com as a major outlet for selling books. Thus, a service code is an impor- tant indicator to potential buyers.
To create a sequence diagram
A new sequence diagram appears with the Sequence Diagram toolbox. The toolbox contains the required elements and connectors.
To draw a sequence diagram
To create a message (3, 4, 6, 7), click a message tool. Then click the sending lifeline at the point where you want the message to start, and then click the receiving lifeline.
An execution occurrence (5) appears at the receiving lifeline. The execution occurrence represents a period of time during which the instance is executing a method. You can create other messages that start from an execution occurrence.
3.found messageslost messages
4.
To change the order of messages
- or -
To move or copy message sequences on the sequence diagram
A copy of the message and all its subsidiary messages is added to the end of the execution occurrence, or to the end of the lifeline.
To display and edit the signature text for a message
-or-
To improve the layout of a sequence diagram
To change the package that owns the interaction
- or -
Right-click the Interaction, and then click Cut. Right-click the Package, and then click Paste.
Creating and Using Simple Sequence Diagrams
The simplest and most widely-used form of sequence diagram contains just lifelines and messages. A diagram of this kind lets you show clearly a typical sequence of interactions between objects in your design, or between your system and its users. This is frequently enough to help you discuss and communicate your design.
Here are some things to consider when you draw a simple sequence diagram.
Types of message
There are three tools that you can use to create messages.
A
<
A create message should be the first message that the receiver receives.
Annotating the interactions
To describe more detail about the sequence, you can place a Comment anywhere on the diagram.
Using Comment Links, you can link a comment to lifelines, executions, interaction uses, and fragments.
Use a comment to:
Deciding the Scope of the Diagram
It is important to be clear about what the diagram is intended to show.
Initiating event
Each diagram should show the sequence of interactions that results from one initiating event. This might be, for example:
Level of detail
Sequence diagrams can show different levels of detail. You can decide the level of detail in two separate dimensions almost independently:
Lifelines can represent one of these levels of detail:
Messages can represent one of these levels of detail:
Whether you are exploring existing code or describing a new design, it is frequently useful to draw and discuss the less detailed views.
Describing variations
The diagram shows a single, typical sequence of events. If you want to show alternative possibilities such as failure scenarios, you can either use either of these options:
Assessing the Design
You can use the diagram to assess the distribution of tasks between its objects or components. Consider refactoring if you see these patterns:
Classes and Lifelines
The lifelines in your sequence diagrams show instances of classes or component interfaces. You can name a lifeline in two ways:
For this purpose |
Use this format |
---|---|
Anonymous instance of a type. |
typeName |
Named instance of a type. |
objectName:typeName |
Creating Lifelines from Types
You can create new lifelines from classes that you have already defined, for example on a class diagram.