Question

In: Computer Science

1. Develop a Detailed Sequence Diagram


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.

Solutions

Expert Solution

To create a sequence diagram

  1. On the Architecture menu, click New UML or Layer Diagram.
  2. Under Templates, click UML Sequence Diagram.
  3. Name the diagram.
  4. In Add to Modeling Project, select an existing modeling project in your solution, or Create a new modeling project, and then click OK.

A new sequence diagram appears with the Sequence Diagram toolbox. The toolbox contains the required elements and connectors.

To draw a sequence diagram

  1. Drag Lifelines (1) from the Toolbox onto the diagram to represent instances of classes, components, actors, or devices.
  2. Draw messages to show how the lifelines collaborate to achieve a specific goal.

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

  • Drag a message up or down in its lifeline. You can drag it over other messages, or into or out of an execution block.

- or -

  • Click the message and use the UP ARROW and DOWN ARROW keys to adjust message positions. Use SHIFT+UP ARROW and SHIFT+DOWN ARROW to change the order of the messages.

To move or copy message sequences on the sequence diagram

  1. Right-click a message (3, 4) and then click Copy.
  2. Right-click the execution occurrence (5) or a lifeline (1) from which you want the new message to be sent, and then click Paste. The new sender can be on a different diagram if you want.

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

  • The target lifeline must be bound or mapped to types for the signature text to be visible. To accomplish this task, perform one of the following steps:
    • Right-click the lifeline, and then choose Create Class.

-or-

  • Select the lifeline, press F4, and then in the Properties window, set the Type property to an existing type or specify the name for a new type. Right-click the message label, and then choose Create Operation.

To improve the layout of a sequence diagram

  • Right-click a blank part of the diagram, and then click Rearrange Layout.
  • To undo the operation, click Edit, and then click Undo.

To change the package that owns the interaction

  1. In UML Model Explorer, find the Interaction that the sequence diagram displays.
  2. Drag the Interaction into the Package.

- 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.

  • Use the Synchronous tool to describe an interaction in which the sender waits for the receiver to return a response (3).

A <> arrow will be shown at the end of the execution occurrence. It indicates return of control to the sender.

  • Use the Asynchronous tool to describe an interaction in which the sender can continue immediately without waiting for the receiver (4).
  • Use the Create tool to describe an interaction in which the sender creates the receiver (8).

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:

  • Note what has been achieved at key points in the sequence. This helps readers to see the objectives of the interactions.
  • Describe the overall objective of the whole sequence. Attach the comment to the initial execution occurrence or leave it unattached. For example, "Customer has chosen items from the menu and has been given a price."
  • Describe the responsibilities of each lifeline. Attach the comment to the lifeline. For example, "Ordering Manager collects the customer's menu choices."
  • Note exceptions or alternatives that might be performed as an alternative to the typical sequence shown. For example "Customer can choose to skip the rest of this sequence."
    • Consider using fragments as a more formal alternative to this kind of note.

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:

  • A user initiating a use case, for example, opening the Web page for buying a meal.
  • A message from one system component to another, for example, querying the availability of items that a customer wants to buy.
  • An event triggered by a change of state, for example, stocks of an item falling below a threshold.

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:

  • Objects in the program code, which either exists, or you are developing.
  • Components or their subcomponents, usually omitting facades, proxies, and other connective mechanisms.
  • Your system and external actors

Messages can represent one of these levels of detail:

  • Software messages in the program code, at an API, or Web interface.
  • Transactions or sub-transactions, for example, between users and the system, or between code and database.
  • Use cases - major interactions between users and the system.

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:

  • Draw separate sequence diagrams to describe those scenarios
  • Use Describing Control Structures with Fragments to show loops, alternatives, and so on.

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:

  • One lifeline seems to do everything, making calls to everything else, whereas the other lifelines just respond passively.
  • Many messages cross lifelines. Each lifeline should send messages to just a few neighbors, and should not communicate with its neighbors' neighbors. It should usually be possible to arrange the lifelines so that there are only a few places where messages cross lifelines; and where there are crossings, the target lifeline should not also exchange messages that have the crossed lifelines.
  • Some lifelines seem to handle more than one kind of task. It should easy to find one succinct sentence that describes the responsibilities of each lifeline, summarizing the work it does in response to each message that it receives.

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.

Use this if you have only one lifeline of each type.

typeName

Named instance of a type.

Use this if you want to show a sequence that involves more than one instance of the same 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.


Related Solutions

Draw a detailed diagram of the TLC process
Draw a detailed diagram of the TLC process
Prepare a diagram in Word, or on poster. The diagram should be detailed enough to communicate...
Prepare a diagram in Word, or on poster. The diagram should be detailed enough to communicate the sensory and motor pathways through the body. Trace the sensory pathway from the receptors of the skin to the sensory area of the cerebrum. Trace the motor pathway from the motor area of the cerebrum to the muscles. Address the patient's concern: What is the anatomical foundation that explains why patients who have had strokes on the right side of the cerebrum have...
Develop a scatter diagram for these data. Develop the estimated regression equation.
Given the following: X: 1    2    3 4    5 Y: 3    7    5    11    14 Develop a scatter diagram for these data. Develop the estimated regression equation. Use the estimated regression equation to predict the value of Y when X = 4
Instruction: Use Microsoft Visio to draw a use case diagram and a sequence diagram for the...
Instruction: Use Microsoft Visio to draw a use case diagram and a sequence diagram for the following business requirements. Online Recruiting System (website) 1) The Online Interview System: The search committee usually selects 3 to 5 candidates for a Skype interview. When the search committee starts a Skype interview, they connect their web browsers to an interview module developed by the company’s IT team (we call this type of software as home-developed software). The interview module then connects to Skype....
How do know when to model an activity diagram and when to model a sequence diagram?
How do know when to model an activity diagram and when to model a sequence diagram?
give detailed answers 1. what is the difference between shine Dagarno and Kozak sequence ? 2....
give detailed answers 1. what is the difference between shine Dagarno and Kozak sequence ? 2. discuss ribosomal components
Please give a detailed explanation of the Intertemporal budget constraint with diagram.
Please give a detailed explanation of the Intertemporal budget constraint with diagram.
Ex1) Develop an activity diagram and use case diagram based on the following narrative. The purpose...
Ex1) Develop an activity diagram and use case diagram based on the following narrative. The purpose of the Open Access Insurance System is to provide automotive insurance to car owners. Initially, prospective customers fill out an insurance application, which provides information about the customer and his or her vehicles. This information is sent to an agent, who sends it to various insurance companies to get quotes for insurance. When the responses return, the agent then determines the best policy for...
develop a DETAILED performance appraisal procedure with the performance appraisal FORM
develop a DETAILED performance appraisal procedure with the performance appraisal FORM
Design a Mealy state diagram for a sequence detector that has a single input and a...
Design a Mealy state diagram for a sequence detector that has a single input and a single output. The output is to be “1” unless the input has been “0” for four consecutive clock pulses or “1” for three consecutive pulses. Implement your design using D flip-flops and any logic gates. Assume non-overlapping input sequences are to be detected.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT