1 / 40

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING (2016-17) OBJECT ORIENTED ANALYSIS AND DESIGN

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING (2016-17) OBJECT ORIENTED ANALYSIS AND DESIGN III B. Tech II Sem UNIT-3. Sequence and collaboration diagrams. Interaction diagrams. What are interaction diagrams?.

ajung
Download Presentation

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING (2016-17) OBJECT ORIENTED ANALYSIS AND DESIGN

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING (2016-17) OBJECT ORIENTED ANALYSIS AND DESIGN III B. Tech II Sem UNIT-3

  2. Sequence and collaboration diagrams Interaction diagrams

  3. What are interaction diagrams? Interaction diagrams illustrate how objects interact via messages in order to fulfil certain tasks. There are two kinds of interaction diagrams: collaboration diagrams sequence diagrams

  4. Collaboration and sequence diagrams: main differences Collaboration diagram illustrates object interactions in a graph or network format, in which objects can be placed anywhere on the diagram. It demonstrates how objects are statically connected. Sequence diagram illustrates interaction in a kind of fence format, in which each new object is added to the right. It generally shows the sequence of events that occur.

  5. Interaction diagrams: when and how to use them? Identify the system events that are implied by the use cases. Make at least one interaction diagram for each system event. Make additional interaction diagrams for alternative courses of events.

  6. Interaction diagrams: notation The following notation is used in the UML for classes and objects: Class Instance of a Class(object without a name) Named instance of a class(named object) Named object only (shown without class) Person :Person michael:Person michael

  7. Types of message flows Synchronous: the sender waits until the responder finishes. Flat: the sender doesn't wait for anything from the responder and finishes its' activity; the control is passed to the responder. Asynchronous: the sender doesn't wait for anything from the responder, but it continues its' own activity.

  8. Collaboration diagrams A collaboration diagram shows the relationship between objects and the order of messages passed between them. The objects are listed as icons and arrows indicate the messages being passed between them. The numbers next to the messages are called sequence numbers and, as the name suggests, they show the sequence of the messages as they are passed between the objects.

  9. Collaboration diagram – an example

  10. Collaboration diagrams – more complex example

  11. Static model based on previous collaboration diagram

  12. Collaboration diagrams – strenghts and weaknesses One of the greatest strengths of collaboration diagrams is their simplicity. The principal weakness, however, is that although they are good at describing behavior, they do not define it. They typically do not show all the iteration and control that is needed to give an computationally complete description.

  13. Sequence diagrams A sequence diagram shows relations between objects. It should be read from left to right and from top to bottom. At the top of the diagram are names of objects that interact with each other. These are the concepts in the conceptual model. When the course of events is initiated by an actor the actor symbol is displayed as the leftmost object.

  14. Sequence diagrams: an example Actor Instances of classes

  15. Sequence Diagram: Lifelines :object3 :object1 :object2 Each object has a lifeline. Time flows from top to down. :actor Time

  16. Rectangles refer to events that are related to each other. Sequence diagrams: rectangles :object1 :object2 :object3 :actor Time

  17. Sequence diagrams: messages Arrows indicate messages that are sent from one object to another. :object1 :object2 :object3 :actor Time

  18. Sequence diagrams - different types of messages Message An object sends a message to itself. Feedback arrow shows that a value is returned.

  19. Sequence diagrams: endpoints X at the end of the lifeline shows that the object ceases to exist.

  20. Sequence diagram: a more complex example

  21. Sequence diagrams - strengths and weaknesses Strengths: - they clearly show sequence or time ordering of messages - the notation is rather simple Weaknesses: - forced to extend to right when adding new objects, consumes a lot of space

  22. Use Cases and Actors • A use case • Specifies the behavior of a system • Represents a functional requirement of your system as a whole • Describes what a system not how it does it • An actor • Represents users of use case play when interacting with use cases • It’s not part of the system

  23. Use Cases and Actors

  24. Organizing Use Cases • Organize use case by specifying • Generalization • Include • The base use case pulling behavior from the supplier use case • Extend • Pushing behavior to the base use case

  25. Use Case Diagrams • A use case diagram • A diagram shows a set of use cases and actors and their relationship • Contents • Use cases • Actors • Dependency, generalization, and association relationships

  26. Use Case Diagrams

  27. Activity Diagrams • Activity diagrams represent the dynamics of the system. • They are flow charts that are used to show the workflow of a system. • They show. • The flow of control from activity to activity in the system, • What activities can be done in parallel. • Alternate paths through the flow. • They can show the flow across use cases or within a use case. • Core symbol is an activity.

  28. Activity Diagram • An activity is some task which needs to be done. • Each activity can be followed by another activity (sequencing). • Triggers from the activity may be guarded as in state diagrams.

  29. Decision Activities • Diamond. • Each trigger coming from it has a guard. • Synchronisation bar. • All triggers from this attach to activities that can occur in parallel, with no specific sequence, or concurrently. • The next synchronisation bar closes the concurrency. • Iteration is represented by a * on the trigger.

  30. ActivityDiagram Example

  31. Swimlane • Arrange activity diagrams into vertical zones separated by dashed lines. • Each zone represents the responsibilities of a particular class or department.

  32. Swimlane Example

  33. Use Case Diagram:- Library Management System

  34. Activity Diagram for Issue Book in Library

  35. Activity Diagram for Return Book in Library:-

  36. Collaboration diagram for issuing Book:

  37. Collaboration diagram for returning Book:

  38. Sequence diagram for issuing book:

  39. Sequence diagram for returning book:

  40. THANK YOU

More Related