10 - interaction diagram
TRANSCRIPT
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
Faculty of Computer Science University of Indonesia
IKI30202 - Rekayasa Perangkat LunakTerm 1 - 2011/2012Lecturers: Dr. Indra Budi, S.Kom., M.Kom. Puspa Indahati Sandhyaduhita, S.T., M.Sc. Satrio Baskoro Yudhoatmojo, S.Kom., M.T.I.1
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
Faculty of Computer Science University of Indonesia
Interaction Diagram
2
Acknowledgement
Main Material [Dennis, 2010] Dennis, Alan, et al, System Analysis and Design with UML, 3rd Edition, John Wiley & Sons, New Jersey, 2010.
Supplementary Materials [Miles & Hamilton, 2006] Miles, Russ, and Kim Hamilton. Learning UML 2.0. Beijing: O'Reilly, 2006. Print. [OMG, 2005] Unified Modeling Language: Superstructure. Object Management Group, 2005. Print.3
Key Ideas
Behavioral models describe the internaldynamic aspects of an information system that supports business processes in an organization
Key UML behavioral models are:sequence diagrams, collaboration diagrams, and statechart diagrams
4
BEHAVIORAL MODELS
5
Behavioral Models
Systems have static &dynamiccharacteristics Structural models describe the static aspects of the system Behavioral models describe the dynamics and interactions of the system and its components
Behavioral models describe how theclasses described in the structural models interact in support of the use cases.6
INTERACTION DIAGRAMS
7
Interaction Diagrams
Use cases and classes alone are not enabling use to model how the system is actually going to its job. Use cases allow your model to describe what your system must be able to do. Classes allow your model to describe the different types of parts that make up your systems structure.
Interaction diagrams model important runtime interactions between the parts that make up your system.Source: [Miles & Hamilton, 2006]8
Interaction Diagrams
Logical View
Process View
Use Case View
Physical View
Development View
Source: [Miles & Hamilton, 2006]9
Interaction Diagram Components
Objects an instantiation of a class
Operations the behaviors of an instance of a class
Messages information sent to objects to tell them to execute one of their behaviors10
Sequence Diagrams
Capture the order of interactionsbetween parts of your system
Illustrate the objects that participate in ause-case Describe which interactions will be triggered when a particular use case is executed and in what order those interactions will occur [Miles & Hamilton, 2006]
Show the messages that pass betweenobjects for a particular use-case11
Sequence Diagram SyntaxParticipants are parts of your system that interact with each other during the sequence. A participant can represent an actor, an object of a class, a table of a database, or anything that is part of your system. Participants will send / receive a sequence of messages. A lifeline denotes the life of an object during a sequence. If the participant is no longer participating in the interaction then at the end of the lifeline there would be an X symbol. An execution occurrence is a long narrow rectangle placed atop of lifeline which denotes when a object is sending or receiving messages. Message conveys information one object to another one. An operation call is labeled with the message being sent and a solid arrow and a return is labeled with the value being return and shown as a dashed arrow. A guard condition represents a test that must be met for the the message to be sent. For participant destruction, an X is placed at the end of a participants lifeline to show that it is going out of existence. A frame or border indicates the context of the sequence diagram. 12
An Example of a Sequence Diagram
Source: [Miles & Hamilton, 2006]13
Steps to Build Sequence Diagrams1. Set the context 2. Identify which objects will participate
3. Set the lifeline for each object4. Lay out the messages from top to bottom of the diagram based on the order in which they are sent 5. Add execution occurrence to each objects lifeline 6. Validate the sequence diagram14
BEHAVIORAL STATE MACHINES
15
Behavioral State Machines
A dynamic model that shows the different states through which a single object passes during its life in response to events, along with its responses and actions For example, they can be used to model the behavior of individual entities (e.g., class instances) [OMG, 2005]. Its helpful to model states of an object and the events causing state changes [Miles & Hamilton, 2006].
Typically not used for all objects Just for complex ones16
Components of State Machines
States
Events
values of an objects attributes at a point in time
Transitions
change the values of the objects attributes
Actions
movement of an object from one state to another
Activities
atomic, non-decomposable processes
non-atomic, decomposable processes17
State Machine Syntax
18
An Example of a State Machine
State machine diagram of an AccountApplication (Source: [Miles & Hamilton, 2006])19
Steps to Build a State Machine1. Set the context 2. Identify the initial, final, and stable states of the object 3. Determine the order in which the object will pass through the stable states 4. Identify the events, actions, and guard conditions associated with the transitions 5. Validate the behavioral state machine20
Q&A