chp 41.pdf

Upload: parth-kunder

Post on 03-Jun-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Chp 41.pdf

    1/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    Chapter 7 Understanding Dynamic Modeling

    An object-oriented design should represent the structural and behavioral aspects of a software system.Static modeling is used to represent the structural constituents of a software system. Dynamic modeling is

    used to represent the behavior of the structural constituents. Dynamic modeling uses various types of diagrams, such as interaction, state, and activity diagrams.

    This chapter explains the concept of dynamic modeling. In addition, it explains how to create the dynamicmodel of a system by using interaction diagrams.

    Objectives

    In this chapter, you will learn to:

    Identify the concepts of dynamic modeling

    Create interaction diagrams

  • 8/12/2019 Chp 41.pdf

    2/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    Introducing Dynamic Modeling Concepts

    Dynamic modeling is a UML modeling technique that represents the behavior of the static constituents of asoftware system. Therefore, it is also known as behavioral modeling. A designer requires dynamic modelingtechniques to represent the interaction, workflow, and different states of the static constituents in a softwaresystem.

    Need for Dynamic Modeling

    The design of a software system is considered to be the good if it is able to represent what a system shoulddo and how. Without a good design a developer will not be able to code a program correctly. This is

    because coding involves the implementation of the design.

    Modeling techniques are required to represent all aspects of a software system. These modeling techniqueshelp in representing the system requirements, the static constituents of a system, its behavior, and

    architecture.

    Dynamic modeling techniques help the designer to represent the behavior of the static constituents so that adeveloper is able to depict how a system should behave to meet the desired requirements. It providesvarious diagrams such as, interaction, activity, and state diagrams, which help you design the dynamicmodel of a software system.

    Consider the example of Wilson Inc., an automobile manufacturing company, which is planning expansionand, for this reason, wants to automate its inventory control. The management of Wilson Inc. decides toinstall an Inventory Management System (IMS) that will organize the stock reorder level, supplier details,and payments for spare parts records.

    The task of developing the IMS is entrusted upon a development team that creates a dynamic model of theIMS to understand the interaction between the various components of the software system. The dynamicmodel of the IMS is created using various diagrams, such as interaction, state, and activity diagrams.

    The interaction diagram models the interaction between the static constituents of a software system. Theactivity diagrams represent the sequence of activities that the static constituents of a system need to performto complete a process and the state diagrams depict the changes that occur in the state of objects becauseof the interaction among the various constituents of a software system.

    Difference between Static and Dynamic Modeling

    Static modeling is required to represent the physical structure of a software system. However, it isinsufficient as it does not explain how the constituents of the structure behave and interact with each other.To depict the behavior of the structural constituents, you need dynamic modeling. The following table liststhe differences between static and dynamic modeling.

    Static Modeling Dynamic Modeling

    It represents the static or structural It represents the behavior of static constituents

  • 8/12/2019 Chp 41.pdf

    3/43

  • 8/12/2019 Chp 41.pdf

    4/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    Creating Interaction Diagrams

    Interaction diagrams depict how the constituents of a software system interact to realize the use cases of thesystem. In addition, you can use interaction diagrams to generate executable code through forward andreverse engineering. The two components of an interaction diagram are:

    Collaboration : Depicts the static aspect of an interaction diagram.Interaction : Depicts the dynamic aspect of an interaction diagram.

    A collaboration is a collection of instances of classes, the relationship among the instances of classes, andactors. A collaboration groups all the components that are required to realize a use case. The relationshipsamong the components of a collaboration are graphically depicted as links between objects. A link servesas a path over which messages are sent and received.

    Although, abstract classes and interfaces do not have instances, they can form a part of a collaboration .

    You use interactions to depict the flow of control in an operation or among use cases. In an interaction, anobject sends a message to request another object to perform an operation. In other words, an interaction isinitiated when one object requests another object to perform certain operations, and in this way, invokes itsmethods.

    For example, Wilson Inc. has an inventory database that stores the inventory information when a new stock of automobile parts arrives. The inventory manager intimates the supplier and orders automobile parts whenthe stock of a part reaches its reorder level.

    To design the IMS, the development team creates a collaboration for the use case, order parts, which isrealized through the interaction of Order object and the inventory database. The various interactions torealize the use case, order parts are:

    1. Request by the Inventory Manager actor to the object, O1 of class Order , to perform theoperation, issueOrder() .

    2. Request by the issueOrder() operation to the database to store the information about

    the order.3. Signal sent by the database to the object, O1 , to intimate that the data storage operation is

    complete.

    The following figure shows the flow of control to realize the order parts use case of the IMS.

  • 8/12/2019 Chp 41.pdf

    5/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    There are multiple slots in a collaboration, called roles, which are filled by objects and links at run time. Inother words, roles are used to depict the run-time responsibility of the objects of a class and the

    relationship. The two types of roles in a collaboration are:

    Classifier roles : Describe objects that can form a part of the collaboration.Association roles : Describes the links that can form a part of the collaboration.

    An interaction signifies the collection of communications that occur among theclassifier roles across the association roles. A collection of communicationsindicates the messages that flow from one classifier role to another .

    When an object calls the methods of another object, a sequence of messages flow between them. Thefollowing table lists the various types of messages that can be sent from one object to another and their graphical representation in an interaction diagram.

  • 8/12/2019 Chp 41.pdf

    6/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    The commonly used interaction diagrams are Sequence diagram and Communication diagram. Let us,discuss how to create these diagrams.

    Creating Sequence Diagrams

    Sequence diagrams represent an interaction among objects in the form of messages ordered in a sequence by time. In a sequence diagram, you arrange objects across the x-axis. You place the object that starts aninteraction to the extreme left. The objects that come later in the message sequence are placed to the rightof the interaction-initiating object. The messages sent and received by the objects in an interaction are

    placed along the y-axis in an increasing order of time.

    The following figure depicts the arrangement of objects and messages in a sequence diagram.

    An object may be created or destroyed when an operation is performed. You can use sequence diagramsto depict the creation and destruction of an object. In addition, sequence diagrams depict the change in thefocus of control of an object in the form of a rectangular bar. The length of rectangle bar represents theduration of time for which an object interacts with another object. The following figure depicts a sequencediagram that shows how an object is created and destroyed, the focus of control, and the object lifeline.

  • 8/12/2019 Chp 41.pdf

    7/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    For example, in the IMS system, the order object invokes the issueOrder() method that requests thedatabase to store the information about the order. The following figure depicts the sequence diagram torealize the order parts use case of the IMS.

    When an object invokes its own method or receives a callback from another object, a new focus of controlis represented over the existing focus of control and is called a nested focus of control. The following figureshows the nested focus of control of an object.

  • 8/12/2019 Chp 41.pdf

    8/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    Unlike sequence diagrams, communication diagrams do not depict the object lifeline .

    In a sequence diagram, the flow of control depicts a sequential flow of messages. However, a programminglogic may require you to depict the iterations of messages or the branching of the flow of control. Iterationsare repetitions of messages. You can use the following statement to depict an iteration in a sequencediagram:

    *[ j := 1 .. n ]

    You use an asterisk, *, to indicate that the message is being sent repeatedly. You can depict iteration byusing the following notations:

    [j < 10] : Specifies that the message will be sent until the value of j is less than 10.[val not found] : Specifies that the message will be sent until val is found.

    The following sequence diagram depicts that the Math object requests the numberPropertiesobject to calculate if a number is prime or not, iteratively.

  • 8/12/2019 Chp 41.pdf

    9/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    Branching of messages occurs when a set of messages responds to a call. The message to be sent isguarded by a condition, which is a Boolean expression. If the condition evaluates to true, then the firstmessage is sent, otherwise, the second message is sent. There is no specification on what type of conditionsyou may include in your interaction diagrams. You can use either an English language expression or a

    programming language expression. You can use the following English language expression to depict acondition:

    [ j less than zero ]

    The following statement shows how you can use a programming language expression to write a condition:

    [ j < = 0 ]

    To depict the receipt of messages by an object, you can divide the object lifeline into branches. Thefollowing figure shows how to divide an object lifeline into branches.

  • 8/12/2019 Chp 41.pdf

    10/43

  • 8/12/2019 Chp 41.pdf

    11/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    Identify the objects that have higher responsibility in the interaction. To draw a sequencediagram, place the objects with high responsibility on one side and the low responsibilityobjects on the other.Identify the lifeline of each object in view of the control to depict the creation and destructionof an object.Identify the messages that flow between the lifeline of objects. You also need to identify the

    properties of these messages to obtain information about the semantics of the interaction.Identify the preconditions and post conditions for each message to control the flow of objects.

    Creating Communication Diagrams

    Communication diagrams represent the interaction among objects in the form of messages. To draw acommunication diagram, you identify the objects in collaboration and represent them as the vertices of agraph. After you place the objects, you can draw straight lines that represent the links among these objectsto connect the objects. Note that objects send and receive messages across these links. The dynamicaspect of an interaction diagram can be depicted by messages that are passed among objects across links.Therefore, communication diagrams depict the organization of objects in the sequence of messages flowing

    between them. The constituents of a communication diagram are organized in such a way that the relatedobjects are closely placed. The following figure shows a collaboration and the messages passed in thecollaboration.

    Unlike communication diagrams, sequence diagrams do not have paths that link objects and messages arranged according to time .

    You can number the messages in a communication diagram for sequencing and indicating their time order.The sequence numbers are prefixed before the messages. The following figure shows the path between twoobjects and messages with sequence numbers in a collaboration.

  • 8/12/2019 Chp 41.pdf

    12/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    The following figure shows the objects, links, and sequence of messages among the various objects of thecommunication diagram for the use case, process order.

    Sequence and collaboration diagrams are isomorphic. This means that they containthe same information and can be derived from each other. While sequence diagramdepicts the time sequencing of messages, the communication diagram depicts

    structural responsibilities of the participating objects .

    Sequence and communication diagrams are similar because of the fact that both represent collaboration andthe messages flowing between the constituents of the collaboration. You can also depict iterations andconditions in a communication diagram in the same way as in sequence diagrams. You can derive acommunication diagram from a sequence diagram by using the objects and messages of the sequencediagram. Organize the objects so that the related objects are placed together and place a sequence number

    before each message in the communication diagram based on the time ordering depicted in the sequencediagram.

    Similarly, you can derive a sequence diagram from a communication diagram by using the objects andmessages of the communication diagram. Place the objects and draw their respective object lifelines. Drawthe messages among objects according to the sequence specified in the communication diagrams.

  • 8/12/2019 Chp 41.pdf

    13/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    The guidelines that you need to follow when you model a communication diagram are:

    Identify the collaboration that involves an interaction in the system, subsystem, and use cases.Identify the objects that have higher responsibility in the interaction. Draw these objects on agraph so that the objects with high responsibility are placed on one side and the objects withlower responsibility are placed on the other.Identify the links among objects. You need to place the association links to depict therelationship among objects.Identify all the messages that flow across the links established among objects.

    Assigning Responsibilities to Classes

    You need to assign responsibilities to a class or a set of classes to ensure that the software system has therequired functions to suit the requirement document.

    The decisions about responsibilities of classes are taken when interaction diagrams are created. Theyinclude the decision to identify the methods that need to be invoked in one object by another object so that

    each instance of a class carries out its responsibilities. A responsibility is implemented by using methods of classes, which may implement the entire responsibility or collaborate with the other methods to implement aresponsibility.

    Consider the IMS where you need to assign the responsibility of processing an order to a class or multipleclasses. The supplier class has the task to submit the order. The submitOrder() method of thesupplier class has the task to deliver the order. The order class stores the information about the

    parts accepted and rejected. The order class accepts and evaluates the order received from the supplier.The IMS database stores the information about the order and the quantity of parts received and rejected.The three collaborators for processing an order are supplier class, order class, and inventory

    database .

    The following figure depicts the communication diagram with the objects carrying out their responsibilities to process an order.

    The guidelines that you need to follow when you assign responsibilities to objects are:

  • 8/12/2019 Chp 41.pdf

    14/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    Assign responsibilities to classes such that they perform all the tasks that are performed by thereal-world entity that the classes represent.Assign responsibilities to a class if the class has the attributes that will enable it to fulfill theresponsibilities.Assign responsibilities to multiple classes if all the classes have the data to fulfill theresponsibility.Distribute responsibilities evenly to the various classes of your software system.Check that all the classes of the software system have some responsibility assigned to them. If no responsibility is assigned to a class, you need to check whether the class is required.Check if too many or unrelated responsibilities have been assigned to a class. If such a classexists, split the class into smaller classes.

    Just a minute:

    Which of the following diagrams represents the interaction among objects inthe form of messages?1. Composite structure diagram2. Communication diagram3. Timing diagram4. Interaction Overview diagram

    Answer:2. Communication diagram

  • 8/12/2019 Chp 41.pdf

    15/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    Activity: Modeling the Dynamic View of the Bank ATM System

    Problem Statement

    Janes Technology has been assigned the task of creating a dynamic model of the prototype for theInfoSuper bank ATM system. Janes Technology needs to implement only the cash withdrawal system in the

    prototype for the InfoSuper bank. The following table describes the classes, attributes, and operations for the cash withdrawal feature of the InfoSuper bank, which the design team of Janes Technology hasidentified.

  • 8/12/2019 Chp 41.pdf

    16/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

  • 8/12/2019 Chp 41.pdf

    17/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    The design team has also created the following class diagram after identifying the classes and operations for InfoSuper bank.

    Identify the activities that the development team needs to perform to model the dynamic view of the prototype.

    Prerequisite : To perform this activity, you will need the BANK_ATM.vsd file, which you created in theactivity Modeling the Static View of the Bank ATM System of Chapter 6 .

    Solution

    To model the dynamic view of the cash withdrawal feature of the ATM system, you need to perform thefollowing tasks:

    1. Identify the collaboration and interactions.2. Create a sequence diagram.

  • 8/12/2019 Chp 41.pdf

    18/43

  • 8/12/2019 Chp 41.pdf

    19/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    The following figure depicts the communication diagram for the cash withdrawal feature of the InfoSuper bank ATM system.

  • 8/12/2019 Chp 41.pdf

    20/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    Task 2: Creating a Sequence Diagram

    To create a sequence diagram, you need to perform the following steps:

    1. Select StartAll ProgramsMicrosoft OfficeMicrosoft Office Visio forEnterprise Architects .

    2. Open the Bank_ATM Visio file. The Bank ATM model appears.3. Right-click the Iteration2 folder in the Model Explorer window, and select

    NewSequence Diagram. The Sequence-1 tab with a blank drawing page appears.

  • 8/12/2019 Chp 41.pdf

    21/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    4. Drag the Object Lifeline symbol ( ) from the UML Sequence (Metric) stencil on thedrawing page.

    5. Double-click the Object Lifeline symbol to set its properties. The UML Classifer RoleProperties dialog box appears.

    6. Type CS in the Name text box.7. Select Iteration2::CardScanner from the Classifier drop-down list, as shown in the

    following figure.

    8. Click the OK button. The following figure shows the object lifeline symbol for theCardScanner class.

    9. Right-click the Object Lifeline symbol and click the Shape Display Options option. The

  • 8/12/2019 Chp 41.pdf

    22/43

  • 8/12/2019 Chp 41.pdf

    23/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    14. Drag the Activation symbol ( ) from the UML Sequence (Metric) stencil on the drawing page to represent the time period during which an object or actor is performing an action and place it over the object lifeline symbol for CardScanner. Adjust the length of the activationsymbol as per requirement. The sequence diagram appears as shown in the following figure.

  • 8/12/2019 Chp 41.pdf

    24/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    15. Similarly, draw the activation symbols for all other classifiers.

    16. Drag the Message (call) symbol ( ) on the drawing page from the UML Sequence(Metric) stencil, to represent the communication between the Bank Customer and CardScanner classifiers, as shown in the following figure.

  • 8/12/2019 Chp 41.pdf

    25/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    17. Double-click the Message (call) symbol to set its properties. A UML MessageProperties dialog box appears.

    18. Type AcceptCard and 1: in the Name and Sequence expression text boxes, respectively.19. Select AcceptCard from the Operation drop-down list, as shown in the following figure.

  • 8/12/2019 Chp 41.pdf

    26/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    In the UML Message Properties dialog box , Name refers to the name of the message . Operation refers to the operation to be invoked when themessage reaches the target object . Sequence expression refers to the

    sequence number of the message .

    20. Click the OK button.After setting the properties, the method is displayed, as shown in the following figure.

    21. Right-click the Message (call) symbol and select the Shape Display Options option. TheUML Shape Display Options dialog box appears.

    22. Clear the Message arguments check box in the General options section and click the OK button. The sequence diagram appears as shown in the following figure.

  • 8/12/2019 Chp 41.pdf

    27/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    23. Similarly, represent the communication between all the objects, as shown in the followingfigure.

  • 8/12/2019 Chp 41.pdf

    28/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    Task 4: Creating a Communication Diagram

    To create a communication diagram, you need to perform the following steps:

    1. Right-click the Iteration2 folder in the Model Explorer window, and selectNewCollaboration Diagram . The Collaboration-1 tab with a blank drawing pageappears.

    2. Drag the Classifier Role symbol ( ) from the UML Collaboration (Metric) stencil onthe drawing page.

    3. Double-click Object1 to set its properties. The UML Classifier Role Properties dialog

  • 8/12/2019 Chp 41.pdf

    29/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    box appears.4. Type AC in the Name text box.5. Select Iteration2::ATMCard from the Classifier drop-down list and 1..1 from the

    Multiplicity drop-down list, as shown in the following figure.

    6. Click the OK button. The classifier role for the ATMCard class appears, as shown in thefollowing figure.

    7. Right-click the classifier role, AC and select the Shape Display Options option. The UMLShape Display Options dialog box appears.

    8. Select the Classifier name check box in the General options section.9. Click the OK button. The classifier role, AC appears as shown in the following figure.

    10. Similarly, draw classifier roles for the following classes:BankCustomer

  • 8/12/2019 Chp 41.pdf

    30/43

  • 8/12/2019 Chp 41.pdf

    31/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    12. Double-click the association role symbol. A UML Association Role Properties dialog boxappears.

    13. Select Initiate Transaction from the Base Association drop-down list in the UMLAssociation Role Properties dialog box, as shown in the following figure.

  • 8/12/2019 Chp 41.pdf

    32/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    Two classifier roles in a communication diagram can be connected byusing an association role only if the classes corresponding to the twoclassifier roles are connected through an association in thecorresponding class diagram .

    If in the UML Association Role Properties dialog box, the Baseassociation drop-down list is disabled, there may be two possiblereasons for that:

    The corresponding base association does not exist in the classdiagram .The direction of the association in the communication diagramneeds to be reversed. For example, if End1 of the association role isconnected to ClassifierRoll1 and End2 of the association role isconnected to ClassifierRole 2, you may need to connect End1 toClassifierRole 2 and End2 to ClassifierRole 1 .

  • 8/12/2019 Chp 41.pdf

    33/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    Base Association drop down list will have different values for different Associations depending upon the relationship created between theclasses in the class diagram .

    14. Click the OK button.

    The following figure shows the association relationship between DisplayScreen andTransaction classifier roles.

    15. Double-click the association role symbol connecting the DisplayScreen and Transactionclassifier roles to display the methods associated with the association role. The UMLAssociation Role Properties dialog box appears.

    16. Select Messages from Categories section in the UML Association Role Propertiesdialog box. The Messages section appears as shown in the following figure.

  • 8/12/2019 Chp 41.pdf

    34/43

  • 8/12/2019 Chp 41.pdf

    35/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    21. Click the OK button. The UML Association Role Properties dialog box appears anddisplays the changed properties for the message.

    22. Click the OK button. The message appears with the association role, as shown in thefollowing figure.

  • 8/12/2019 Chp 41.pdf

    36/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    23. Right-click the association role symbol connecting the DisplayScreen and Transaction

    classifier roles and select the Shape Display Options option. The UML Shape DisplayOptions dialog box appears.

    24. Clear the Message arguments check box in the General options section and click the OK button. The message appears as shown in the following figure.

  • 8/12/2019 Chp 41.pdf

    37/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    25. Double-click the association role symbol connecting DisplayScreen and Transaction to

    display other associated messages. The UML Association Role Properties dialog boxappears.

    26. Select Messages from Categories section in the UML Association Role Propertiesdialog box. The Messages section appears.

    27. Click the New button. A new message is added in the Messages section as shown in thefollowing figure.

  • 8/12/2019 Chp 41.pdf

    38/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    28. Click the Properties button. The UML Message Properties dialog box appears.29. Type Prompt in the Name text box.30. Select backward from the Direction drop-down list and Prompt from the Operation drop-

    down list.31. Type 13: in the Sequence expression text box, as shown in the following figure.

  • 8/12/2019 Chp 41.pdf

    39/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    32. Click the OK button.33. Similarly, add the other messages between DisplayScreen and Transaction classifier roles. The

    following figure represents the messages associated with the DisplayScreen and Transactionclassifiers.

  • 8/12/2019 Chp 41.pdf

    40/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    To represent the self association you can use Association role ( )

    symbol insteadof Association role ( ) symbol. There is no differencebetween the functionality of these symbols .

    34. Similarly, draw the relationship between all other classifier roles and display the messagesassociated with them, as shown in the following figure.

  • 8/12/2019 Chp 41.pdf

    41/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    35. Save and close the Bank _ATM model.36. Close Microsoft Visio.

  • 8/12/2019 Chp 41.pdf

    42/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    ww.niitstudent.com/india/Content/063OUML1S1/OEBPS/13_ch07.htm

    Summary

    In this chapter, you learned that:

    Dynamic modeling is used to understand the interaction among objects and the states of objects of software systems.

    Interaction diagrams show an interaction between the objects of a collaboration. There are four types of interaction diagrams: sequence, communication, timing, and interaction overview.Sequence diagram is a type of interaction diagrams that is used to model the flow of control bytime ordering.Communication diagrams represent the interaction among objects in the form of messages.

    Exercises

    Exercise 1Blue Valley Consulting Inc. decides to further enhance the functionality of the system that will enable theOperations Manager to enter details of transactions on monthly basis. This functionality will also provide auser interface that will allow the Operations Manager to add, modify, and delete cash flows. To implementthis functionality, you need to incorporate two modules. The details of these modules are as follows:

    MODULE: RECORD TRANSACTIONS

    Using the Record Transactions module, the Operations Manager can enter the transaction date and amountfor the lease payment for a particular property. The Record Transactions module will be invoked wheneither a new property is leased or a change to the property information occurs.

    MODULE: MAINTAIN SCHEDULE OF CASH FLOW

    This module will provide a user interface where the Operations Manager can enter and review the cashflows. The user interface will also allow the Operations Manager to enter cash flow repeatedly until a givendate.

    Create the sequence and communication diagrams for the two modules.Hint : To complete this exercise, you need to use the Visio file that you created for Exercise 1 of Chapter 6 .

  • 8/12/2019 Chp 41.pdf

    43/43

    8/12 Object-Oriented Analysis and Design Using UML: Student Guide

    Reference Links

    Introducing Dynamic Modeling Concepts

    Reference Reading: Books Reference Reading: URLsThe Unified Modeling

    Language Reference Manual by Grady Booch James RumBaugh Ivar Jacobson Publisher: Pearson Education

    http://www.smartdraw.com/resources/centers/ uml/uml4.htm#whatseq

    Creating Interaction Diagrams

    Reference Reading: Books Reference Reading: URLs

    The Unified Modeling Language User Guide byGrady Booch James

    RumBaugh Ivar Jacobson Publisher: Addison Wesley

    www.sparxsystems.com/EAUserGuide/ interactiondiagrams.htm