Presentation is loading. Please wait.

Presentation is loading. Please wait.

Interaction Diagram An interaction diagram is a graphical representation of interactions between objects. Sequence diagram: shows the sequence in which.

Similar presentations


Presentation on theme: "Interaction Diagram An interaction diagram is a graphical representation of interactions between objects. Sequence diagram: shows the sequence in which."— Presentation transcript:

1 Interaction Diagram An interaction diagram is a graphical representation of interactions between objects. Sequence diagram: shows the sequence in which activities or behaviors occur Collaboration diagram: shows how the objects are connected statically Each provides a different view of the same interaction

2 Sequence Diagram A sequence diagram shows object interactions arranged in time sequence. The diagram shows The objects participating in the interaction The sequence of messages exchanged The diagram contains Objects with their “lifelines” Messages exchanged between objects in ordered sequence Focus of control (optional)

3 Sequence Diagram Example Showing the use case of the refuel class

4 Sequence Diagram … Sequence diagram can be enhanced by using the scripts. A script is written at the left of a sequence diagram with the steps of the script aligning with the object interactions. Scripts can be written in natural language or pseudocode

5 Sample Script

6 Collaboration Diagram A collaboration diagram is an alternate way to represent the messages exchanged by a set of objects The diagram shows object interactions organised around the objects and their links to each other. A collaboration diagram contains Objects Links between objects Messages exchanged between objects Data flowing between objects, if any

7 Collaboration Diagram Example Shows the parking use case

8 State Diagram Used to show the life history of a given class the possible states an object can take the events that trigger the transition from one state to the next the actions that result from each state change The state is one of the possible conditions that it may exist

9 State Diagram Example Black dot: start node Smaller black dot inside a white dot: end node Rectangle: a state Arrow: transition

10 Special States The initial state is entered when an object is created An initial state is mandatory Only one initial state is permitted The initial state is represented as a solid circle A final state indicates the end of life for an object A final state is optional More than one final state may exist A final state in indicated by a bull’s eye

11 Events An event is an occurrence that happens at some point in time The state of the object determines the response to different events Example: Adding a student to a course Creating a new course

12 Transitions A transition is a change from an originating state to a successor state as a result of some stimulus. The successor state could possibly be the originating states A transition may take place in response to an event Transactions can be labelled with events

13 Guard Conditions A guard condition is a Boolean expression of attribute values which allows a transition only if the condition is true.

14 Actions An action is an operation that is associated with a transition Takes insignificant amount of time to complete Considered to be non-interruptible Action names are shown on the transition arrow preceded by a slash

15 More Example State diagrams for the fuel and parts classes

16 More Example … State diagram for the inventory class, orders parts or fuel: a different condition triggers each state

17 Activity Diagram To model the flow of procedures or activities in a class A decision node is used to represent a choice of which activity to invoke

18 Activity Diagram Example An activity diagram for the inventory class It may have two decisions to verify that there is enough fuel to verify that a part is in stock

19 Package Diagram View the system as a small collection of packages, which can be expanded to a larger set of classes Show the dependencies among classes as they belong to different packages Two items are dependent if changes to the definition of one may cause changes to the other

20 Package Diagram Example There are four major packages The service package consists of five key classes

21 Summary Sequence diagram Describing scenarios of use cases Interaction diagram Describing the class State transition diagram Activity diagram Their relationships


Download ppt "Interaction Diagram An interaction diagram is a graphical representation of interactions between objects. Sequence diagram: shows the sequence in which."

Similar presentations


Ads by Google