Interaction Modeling

17,095 views 25 slides Oct 10, 2015
Slide 1
Slide 1 of 25
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25

About This Presentation

Interaction modeling of Object Oriented Programming using Java.


Slide Content

Interaction Modeling Interaction modeling describes how the different elements in an object model interact with each other. The term interacted is a set of exchanged messages between the objects. The interaction model uses :- Use case diagram Sequence diagram Activity diagram Collaboration diagram

Use Case diagram A UML diagram that represents the relationship between actors and use cases, and among the use cases. Represents an “architectural” view of the requirements . Actors :- External entities (e.g., user role, another system) Relationship between actors and use cases :- Initiation Communication Relationship among different use cases :- Enables the decomposition of complex use cases into smaller ones

Example of E-homework Use Case diagram E-homework distribution Teacher Students E-homework submission E-homework grading

Relationships in Use Case Model In UML, there are three kinds of relationships between use cases : Include Relationship Extend Relationship Generalization Relationship

Include Relationship Use case A includes use case B if the flow of events for A contains the flow of events for B A whole-part relationship Allow use case A to access another common use case B In use case description At a particular point during the flow of events Mention the inclusion at that point At any point in the flow of events Mention the inclusion in the quality requirement In the use case diagram <<include>>

Example of Include Relationship <<include>> withdraw Input amount Cancel transaction <<include>> customer

Extend Relationship A use case A extends a use case B if the flow of events in A can occur amid the flow of events in B when certain condition is true It is like an “interrupt” It is used to separate the exceptional behavior from the normal behavior Use case description Mentioned extension in the entry condition in the extending use case Specifying the condition that would trigger the extending use case Use case diagram <<extend>>

Example of Extend Relationship Connection down Deposit withdraw <<extend>> <<extend>> Name: connection down … Entry condition: This use case extends the Deposit and withdraw use case. It is initialized by the system whenever the connection between the customer and the central sever is lost.

Generalization Relationship It is a parent-child relationship between two or more use cause. It is a kind of relationship in which the properties of the parent use case are inherited by the child use case. It can be represented as a directed arrow with a triangle as an arrow head, as shown below :-

Example of Generalization Relationship Account Current Account Savings Account customer

Example of Use Case Diagram

Sequence Model Sequence Model represents the flow of system events, actions, and messages between the objects over a time period. A sequence model is of two types : Scenario Sequence diagram

S cenario A scenario is an instance of a use case showing a typical example of its execution. Scenarios can be presented in UML using either sequence diagrams or collaboration diagrams . Note that a scenario only describes an example of a use case, so conditionality cannot be expressed!

Sequence Diagram A sequence diagram depicts a scenario by showing the interactions among a set of objects in temporal order . Objects (not classes!) are shown as vertical bars . Events or message dispatches are shown as horizontal (or slanted) arrows from the sender to the receiver.

Example of Sequence Diagram

Activity Diagram Describes how activities are coordinated. Is particularly useful when you know that an operation has to achieve a number of different things, and you want to model what the essential dependencies between them are, before you decide in what order to do them. Records the dependencies between activities, such as which things can happen in parallel and what must be finished before something else can start. Represents the workflow of the process .

Activity Diagram Notation Activity1 () Activity2() 1. Activities 2. Transition

Activity Diagram Notation Activity1 () [x>0] [x=0] [x<0] [x>0] [x=0] [x<0] 3. Decision Diamond

Activity Diagram Notation 4. Join Bar 5. Fork Bar 6. Start Marker 7. Stop Marker

Activity Diagram Notation Developers Testers Markers Swimlane Swimlane Swimlane 8. Swimlane

Activity Diagram of Library Member Librarian [borrower] [returner] Find book on shelf Wait in queue Prepare for next member Record borrowing Record return Put book back on shelf [returning] [borrowing]

Collaboration Diagram Collaboration diagrams (called Communication diagrams) depict scenarios as flows of messages between objects:

Example of Collaboration Diagram Collaboration Diagram of Library Management.

Thank You The End.