Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Subject: Object Oriented Analysis and Design
B.Tech III Year II-Semester
Computer Science &Engineering
• Table of Contents
Unit-IV: Use case Realization
• Use case realization;
• UP activity: Analyze a use case;
• What are us...
Learning Objectives
At the end of this unit the student will be in a position to:
• Understand What is Use case Realizatio...
The analysis workflow consists of two key artifacts
1. Analysis Classes : Model the key concepts in the business domain
2....
• Need not to create use case realization for every use case
• Pick the key use cases, and work on these
• Keep realizing ...
Interactions
• Objects don’t sit idle, they interact with one another by passing messages
• An interaction is a behavior t...
Lifelines
• An object lifeline is the vertical dashed line that represents the existence of an
object over a period of tim...
Focus of Control
• The focus of control is a tall, thin rectangle that shows the period of time during
which an object is ...
Messages
• A message is the specification of a communication among objects that conveys
information
• When you pass a mess...
Example:
Synchronous ,Asynchronous Return messages
Synchronous messages: the sender waits for the receiver to finish executing the
...
Interaction diagrams
Sequence diagrams and Communication diagrams which are collectively called
interaction diagrams
are u...
A sequence diagram is an interaction diagram that emphasizes the time ordering of
messages
• these are the richest, and mo...
Documenting the sequence diagram
• You can add “script” to a diagram by placing notes down the left hand side
• This makes...
Structured control in sequence diagram
• Structured controls in sequence diagram are used to show concurrent
execution of ...
Structured control operators
Sd withdrawal
User:Person Bank:ATM
Loop [Invalid password]
enter (password)
valid= verify (pa...
A sequence diagram fragment that contains an alternative combination
fragment
A sequence diagram fragment that includes an option combination fragment
Example sequence diagram – Leave request of an employee
A communication diagram
• is an interaction diagram that emphasizes the structural organization of the
objects that send a...
Example diagram:
Example diagram:
Activity Diagram
Activity diagrams are called Object Oriented flowcharts, Showing flow of control
from activity to activit...
Activity node:
An activity node is an organizational unit within an activity.
Activity nodes are nested groupings of actio...
Branching
Which specifies alternative paths taken based on some Boolean expression.
A branch may have one incoming and two...
Example:
Fork
join
Fork
join
Activity diagram for Airport
check-in module
Activity partitions/swim lanes
• To partition the activity states on an activity diagram into groups we will use
swim lane...
Activity partitions/swim lanes
Customer Sales Warehouse
Request product
Ship order
Pull materials
Process order
Bill custo...
Some other features of Activity diagram
Object and Object Flow
• An object flow is a path along which objects can pass. An...
Input and Output Pin
• An object flow must have an object on at least one of its ends. A shorthand
notation for the above ...
Expansion Region
• An expansion region is a structured activity region that executes multiple times.
Input and output expa...
Exception Handling
• If an error is detected in a piece of code an exception object is created and flow of
control jumps t...
Interruptible Activity Region
• An interruptible activity region surrounds a group of actions that can be
interrupted.
• I...
Buffering data in object nodes
• An object node can act as a buffer for multiple objects. In the given example the
control...
Multiple data flows
 You can draw more than one control flow or object flow coming out of an
action to indicate that more...
Streaming
• You can use an activity diagram to help you describe a pipeline or a series of actions that execute at the sam...
Glossary
Use case Realizations: illustrates how the analysis classes are interacts with the use
Cases
An interaction is a ...
Activity diagrams are called Object Oriented flowcharts, Showing flow of control
from activity to activity
An activity is ...
Quiz
1) What is Interaction diagram?
a) Interaction diagrams are the UML notations for dynamic modeling
of collaborations
...
4) What is a lifeline?
a) It is a frame consisting of a rectangle with a pentagon in its upper
left-hand corner
b) It is a...
6)___________ is a tall, thin rectangle that shows the period of time during
which an object is performing an action.
a) L...
Key:
1) c
2) d
3) a
4) b
5) a
6) b
7) a
8) b
9) c
10) b
Upcoming SlideShare
Loading in …5
×

Ooad content of unit iv

49 views

Published on

Ooad content of unit iv

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Ooad content of unit iv

  1. 1. Subject: Object Oriented Analysis and Design B.Tech III Year II-Semester Computer Science &Engineering
  2. 2. • Table of Contents Unit-IV: Use case Realization • Use case realization; • UP activity: Analyze a use case; • What are use case realizations? • Interactions: Lifelines; Messages; • Interaction diagrams; • Sequence diagrams; • Communication diagrams. • Activity diagrams; What are activity diagrams? • Activity diagrams and the UP; Activities; Activity semantics; • Activity partitions • Exception handling; • Expansion nodes; • Sending signals and accepting events • Advanced object flow features; Multicast and multi receive; • Interaction overview
  3. 3. Learning Objectives At the end of this unit the student will be in a position to: • Understand What is Use case Realization • Understand what is an interaction, messages, and Interaction diagrams. • Able to model the sequence and communication diagrams. • Understand what are activity diagrams.
  4. 4. The analysis workflow consists of two key artifacts 1. Analysis Classes : Model the key concepts in the business domain 2. Use case Realizations: illustrates how the analysis classes are interacts with the use cases Business model [ or domain model] Requirements model Use case Engineer Analyze a Use case UP activity: Analyze a Use case . Use case model Architecture description Analysis classes Use case Realization
  5. 5. • Need not to create use case realization for every use case • Pick the key use cases, and work on these • Keep realizing use cases until you feel that you have sufficient information to understand how the analysis classes work together. • UP is an iterative process, if you want to refine the use case realization you can do it later What are use case realizations Use case realizations show how classes collaborate to realize system functionality. Use case realizations are implicit part of the model. The use case realizations can be turn in to class diagrams and interaction diagrams. Example: use case :BorrowBook identified analysis classes: Book, Ticket, Borrower the actor : Librarian we need to create a use case realization that demonstrate how these classes and objects interact to realize the behavior specified in BorrowBook
  6. 6. Interactions • Objects don’t sit idle, they interact with one another by passing messages • An interaction is a behavior that comprises a set of messages exchanged among a set of objects. • A message is a specification of a communication between objects. • You use interactions to model the dynamic aspects of objects. • You use interactions to model the flow of control within an operation, a class, a component, a use case , or the system as a whole. • You may find an interaction wherever objects are linked to one another. • Using interaction diagrams , you can focus on how messages are dispatched across time. • You can also focus on the structural relationships among the objects in an interaction Example: in web commerce application ,you will find objects on the client (BookOrder) interacting with objects on the server (BookOrderManager)
  7. 7. Lifelines • An object lifeline is the vertical dashed line that represents the existence of an object over a period of time. • Most objects that appear in an interaction diagram will be in existence for the duration of the interaction, so these objects are all aligned at the top of the diagram, with their lifelines drawn from the top of the diagram to the bottom. • Objects may be created during the interaction. their lifelines start with the receipt of the message create. • Objects may be destroyed during the interaction. their lifelines end with the receipt of the message destroy. Example: c:Client | | | | | | | |
  8. 8. Focus of Control • The focus of control is a tall, thin rectangle that shows the period of time during which an object is performing an action. Example: c:Client | | | | | | | | :Transaction | | | | | | | | Set actions() Create() --------------------committed
  9. 9. Messages • A message is the specification of a communication among objects that conveys information • When you pass a message, an action usually results on its receipt • An action may result in a change in state of the target object and objects accessible from it. In the UML, you can model several kinds of messages  Call: Invokes an operation on an objects  Return: Returns a value to the caller  Send: Sends a signal to an object  Create: Creates an objects  Destroy: Destroys an object
  10. 10. Example:
  11. 11. Synchronous ,Asynchronous Return messages Synchronous messages: the sender waits for the receiver to finish executing the requested operation Asynchronous messages: the sender does not wait but continues to the next step. Return messages: the receiver of an earlier message returns focus of control to the sender of that message. Example:
  12. 12. Interaction diagrams Sequence diagrams and Communication diagrams which are collectively called interaction diagrams are used to model the dynamic aspects of system. An interaction diagram shows an interaction, consisting of a set of objects and their relationships, including the messages that may be dispatched among them.  A sequence diagram is an interaction diagram that emphasizes the time ordering of messages  A communication diagram is an interaction diagram that emphasizes the structural organization of the objects that send and receive messages.
  13. 13. A sequence diagram is an interaction diagram that emphasizes the time ordering of messages • these are the richest, and most flexible form of interaction diagram. • Graphically a sequence diagram is a table that shows objects arranged along the X axis and messages, ordered in increasing time, along the Y axis. • Sequence diagram have two features that distinguish them from communication diagrams. 1. Lifeline : existence of an object over a period of time 2. Focus of control or Activations: period of time during which an object is performing an action • The main content in a sequence diagram is the messages. • A message is shown by an arrow from one lifeline to another. • The arrowhead points to the receiver. If the message is asynchronous, the line has a stick arrowhead. • If the message is synchronous (a call), the line has a filled triangular arrowhead. • A reply to a synchronous message( a return from a call) is shown by a dashed arrow with a stick arrowhead.
  14. 14. Documenting the sequence diagram • You can add “script” to a diagram by placing notes down the left hand side • This makes diagram much more accessible to nontechnical users • The script may consist of textual summary of what is happening in the diagram.
  15. 15. Structured control in sequence diagram • Structured controls in sequence diagram are used to show concurrent execution of multiple sequences • A control operator is shown as a rectangular region within the sequence diagram. • It has a tag, a text label inside a small pentagon in the upper left corner to tell what kind of a control operator it is. The following kinds of control are the most common Optional execution: the tag is opt. the body of the control operator is executed if a guard condition is true when the operator is entered. Conditional execution: the tag is alt. the body of the control operator is divided into multiple sub regions by horizontal dashed lines. Each sub region represents one branch of a conditional. Parallel execution: the tag is par. The body of the control operator is divided into multiple sub regions by horizontal dashed lines .each sub region represents a parallel (concurrent) computation. Loop (iterative) execution: The tag is loop. A guard condition appears at the top of one lifeline within the body. The body of the loop is executed repeatedly as long as the guard condition is true before each iteration.
  16. 16. Structured control operators Sd withdrawal User:Person Bank:ATM Loop [Invalid password] enter (password) valid= verify (password) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | opt par [Valid password] Enter (account) Enter (amount) -------------------------------------------------------------------------- Deliver cash
  17. 17. A sequence diagram fragment that contains an alternative combination fragment
  18. 18. A sequence diagram fragment that includes an option combination fragment
  19. 19. Example sequence diagram – Leave request of an employee
  20. 20. A communication diagram • is an interaction diagram that emphasizes the structural organization of the objects that send and receive messages. • Graphically a communication diagram is a collection of vertices and arcs. • You form a communication diagram by first placing the objects that participate in the interaction as the vertices in the graph. • Next, you render the links that connect these objects as the arcs of this graph. • Finally you adorn these links with the messages that objects send and receive. • This gives the flow of control in the context of the structural organization of objects that collaborate.
  21. 21. Example diagram:
  22. 22. Example diagram:
  23. 23. Activity Diagram Activity diagrams are called Object Oriented flowcharts, Showing flow of control from activity to activity An activity is an ongoing non atomic execution within a state machine. Where as Interaction diagrams emphasize the flow of control from object to object Activity diagrams emphasize the flow of control form step to step. An activity is an ongoing structured execution of a behavior. Contents of the activity diagram • Actions • Activity nodes • Flows • Object values Actions: the executable atomic computations are called actions. Example: simple action Bid plan
  24. 24. Activity node: An activity node is an organizational unit within an activity. Activity nodes are nested groupings of actions or other nested activity nodes An Action as a special case of an activity node. Example: Control flows When an action or activity node completes execution, flow of control passes immediately to the next action or activity node. Example: Process bill (b) Select site Commission architect
  25. 25. Branching Which specifies alternative paths taken based on some Boolean expression. A branch may have one incoming and two or more outgoing flows. Example: Forking and Joining • Fork – A black bar ( horizontal/vertical ) with one flow going into it and several leaving it. This denotes the beginning of parallel activities • Join – A black bar with several flows entering it and one leaving it. this denotes the end of parallel activities
  26. 26. Example: Fork join Fork join
  27. 27. Activity diagram for Airport check-in module
  28. 28. Activity partitions/swim lanes • To partition the activity states on an activity diagram into groups we will use swim lanes • Each group representing the business organization responsible for those activities. in the UML each group is called a swim lane • Each group is divided from its neighbor by a vertical solid line.but transitions may cross lanes. • A swim lane specifies a set of activities that share some organizational property. • Each swim lane has a name unique within its diagram. • Each swim lane may be implemented by one or more classes.
  29. 29. Activity partitions/swim lanes Customer Sales Warehouse Request product Ship order Pull materials Process order Bill customerReceive order Pay bill Close order Swim lane
  30. 30. Some other features of Activity diagram Object and Object Flow • An object flow is a path along which objects can pass. An object is shown as a rectangle • An object flow is shown as a connector with an arrowhead denoting the direction the object is being passed. Example:
  31. 31. Input and Output Pin • An object flow must have an object on at least one of its ends. A shorthand notation for the above diagram would be to use input and output pins
  32. 32. Expansion Region • An expansion region is a structured activity region that executes multiple times. Input and output expansion nodes are drawn as a group of three boxes representing a multiple selection of items. The keyword iterative, parallel or stream is shown in the top left corner of the region
  33. 33. Exception Handling • If an error is detected in a piece of code an exception object is created and flow of control jumps to an exception handler that process the exception object. • Exception Handlers can be modeled on activity diagrams as in the example below
  34. 34. Interruptible Activity Region • An interruptible activity region surrounds a group of actions that can be interrupted. • In the very simple example below, the Process Order action will execute until completion, when it will pass control to the Close Order action, unless a Cancel Request interrupt is received which will pass control to the Cancel Order action
  35. 35. Buffering data in object nodes • An object node can act as a buffer for multiple objects. In the given example the control flow shows that the user can go around the [choose more] loop (1) many times, while the Chosen Menu Items object node (2) accumulates the user's choices. Finally, when the user has completed his or her selection, control passes to the Confirm Order action (3), which accepts the complete list of choices from the Chosen Menu Items buffer.
  36. 36. Multiple data flows  You can draw more than one control flow or object flow coming out of an action to indicate that more than one thread emerges when the action ends. The effect resembles that of a fork, except that you can use a mixture of control and object flows. • The following example shows multiple flows out of and into actions.
  37. 37. Streaming • You can use an activity diagram to help you describe a pipeline or a series of actions that execute at the same time, and continuously pass data from one action to another. • The intention in the following example is that each action can produce objects and continue to work. Because there are no control flows, each action can start as soon as it receives its first objects. • Notice that the connectors in this example are object flows, because they all have at least one end on an Activity Parameter Node, Object Node, or on an Input or Output Pin.
  38. 38. Glossary Use case Realizations: illustrates how the analysis classes are interacts with the use Cases An interaction is a behavior that comprises a set of messages exchanged among a set of objects. A message is a specification of a communication between objects. An object lifeline is the vertical dashed line that represents the existence of an object over a period of time. The focus of control is a tall, thin rectangle that shows the period of time during which an object is performing an action. Synchronous messages: the sender waits for the receiver to finish executing the requested operation Asynchronous messages: the sender does not wait but continues to the next step. Return messages: the receiver of an earlier message returns focus of control to the sender of that message.  A sequence diagram is an interaction diagram that emphasizes the time ordering of messages  A communication diagram is an interaction diagram that emphasizes the structural organization of the objects that send and receive messages.
  39. 39. Activity diagrams are called Object Oriented flowcharts, Showing flow of control from activity to activity An activity is an ongoing non atomic execution within a state machine. Swim lanes are used to partition the activity states on an activity diagram into groups An expansion region is a structured activity region that executes multiple times.
  40. 40. Quiz 1) What is Interaction diagram? a) Interaction diagrams are the UML notations for dynamic modeling of collaborations b) Interaction diagrams are a central focus of engineering design c) All of the mentioned d) None of the mentioned 2) What are the different interaction diagram notations does UML have? a) A sequence diagram b) A communication diagram c) An interaction overview diagram d) All of the mentioned 3) What is a sequence diagram? a) A diagram that shows interacting individuals along the top of the diagram and messages passed among them arranged in temporal order down the page b) A diagram that shows messages super imposed on a diagram depicting collaborating individuals and the links among them c) A diagram that shows the change of an individual’s state over time d) All of the mentioned
  41. 41. 4) What is a lifeline? a) It is a frame consisting of a rectangle with a pentagon in its upper left-hand corner b) It is a rectangle containing an identifier with a dashed line extending below the rectangle c) It is a name compartment ; the interaction is represented inside the rectangle d) None of the mentioned 5) What does a message mean? a) It Passes all communications from one object to another and are represented by message arrows in sequence diagrams b) Message goes from the sending object’s lifeline to the receiving object’s lifeline c) It is a rectangle containing an identifier with a dashed line extending below the rectangle d) All of the mentioned
  42. 42. 6)___________ is a tall, thin rectangle that shows the period of time during which an object is performing an action. a) Life line b) Focus of control c) Swim lane d) Synchronization 7) the sender waits for the receiver to finish executing the requested operation a) Synchronous messages b) asynchronous messages c) return messages d) none 8) A _________is an interaction diagram that emphasizes the structural organization of the objects that send and receive messages. a) Sequence diagram b) communication diagram c) Activity diagram d) Interaction overview diagram 9) __________ are called Object Oriented flowcharts, Showing flow of control from activity to activity a) interaction diagrams b) object diagrams c) Activity diagrams d) all 10) ___________is a black bar ( horizontal/vertical ) with one flow going into it and several leaving it. This denotes the beginning of parallel activities a) Synchronization bar b) fork c) join d) all
  43. 43. Key: 1) c 2) d 3) a 4) b 5) a 6) b 7) a 8) b 9) c 10) b

×