1 / 79

Behavioral Diagrams in Use Case, Sequence, Collaboration, State Chart, and Activity Diagrams

Learn about the different types of behavioral diagrams, including use case, sequence, collaboration, state chart, and activity diagrams, and understand their purpose and components.

emark
Download Presentation

Behavioral Diagrams in Use Case, Sequence, Collaboration, State Chart, and Activity Diagrams

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. UNIT- 4 Behavioral Diagrams P. P. Mahale

  2. Behavioral Diagrams • Use Case Diagram – high-level behaviors of the system, user goals, external entities: actors • Sequence Diagram – focus on time ordering of messages • Collaboration Diagram – focus on structural organization of objects and messages • State Chart Diagram – event driven state changes of system • Activity Diagram – flow of control between activities

  3. Use case Diagram • A use case diagram is a diagram that shows a set of use cases and actors and their relationships. Common Properties • A use case diagram is just a special kind of diagram and shares the same common properties as do all other diagrams a name and graphical contents that are a projection into a model.

  4. Use case Diagram Contents • Use case diagrams commonly contain • Use cases • Actors • Dependency, generalization, and association relationships Common Uses • To model the context of a system • To model the requirements of a system

  5. Use case Diagram Terms and Concepts • A use case diagram is a diagram that shows a set of use cases and actors and their relationships. Names • Every use case must have a name that distinguishes it from other use cases. A name is a textual string. Figure Simple and Path Names

  6. Use case Diagram Use Cases and Actors • An actor represents a coherent set of roles that users of use cases play when interacting with these use cases. Typically, an actor represents a role that a human, a hardware device, or even another system plays with a system. Figure : Actors

  7. Use case Diagram Use Cases and Flow of Events • A use case describes what a system does but it does not specify how it does it. • You can specify the behavior of a use case by describing a flow of events in text clearly enough for an outsider to understand it easily. • For example, in the context of an ATM system, you might describe the use case Validate User in the following way: • Main flow of events: • Exceptional flow of events:

  8. Use case Diagram Use Cases and Scenarios • A scenario is a specific sequence of actions that illustrates behavior. Use Cases and Collaborations • As Figure shows, you can explicitly specify the realization of a use case by a collaboration. Figure : Use Cases and Collaborations

  9. Use case Diagram Organizing Use Cases • You can organize use cases by grouping them in packages in the same manner in which you can organize classes. Figure : Generalization, Include, and Extend

  10. Use case Diagram

  11. Interaction Diagrams • Sequence diagrams and collaboration diagramsboth of which are called interaction diagrams Sequence Diagrams • A sequence diagram emphasizes the time ordering of messages. Figure : Sequence Diagram

  12. Interaction Diagrams • Sequence & collaboration are call interaction diagram used for modeling dynamic aspect of system • It represent interaction, consist of set of objects & their relationships including message • Sequence diagram is an interaction diagram that shows time ordering of messages • Collaboration diag. is an interaction diagram that shows structural organization of object that send & receive message • Model particular flow of control of use case

  13. Graphically sequence diagram is table that shows objects arrangedin x-axis & messages ordered in increasing time along y-axis • Graphically collaboration diagram is collection of vertices & arcs • Common properties of interaction diagram : • Share common properties such as name & graphical content • Content of interaction diagram : • Object • Link • Messages - Also contains notes & constraints

  14. Sequence diagram :- • Shows time ordering • Formed by placing objects that participate in interaction at top of diagram • Place object that initiate interactionat the left & increasingly more subordinate objects to right • Place message that these object send & receive along y-axis in order of increasing time from top to bottom • 2 feature that distinguish from collaboration • There is object life line: • It is vertical dashed line that represent existence of an object over a period of time • Object are aliened at top with their life line dawn from top to bottom

  15. 2. There is focus of control - It is tall, thin, rectangular that shows period of time in which an object perform an action - Top of rectangle is aliened with start of action, bottom with completion

  16. 2. Collaboration Diagram • It shows structural organization of object that participate in interaction • It formed by placing object that participate in interaction as vertices in graph • show link that connect these object as arc • Show message that object send & receive

  17. Interaction Diagrams Collaboration Diagrams • A collaboration diagram emphasizes the organization of the objects that participate in an interaction. Figure : Collaboration Diagram

  18. Interaction Diagrams Timing Diagrams • Timing diagrams are a special representation of interactions that focus on the specific timings of messages sent between objects. • You can use timing diagrams to show detailed time constraints on messages or to show when changes occur within lifelines with respect to time. • Timing diagrams are most often used with real-time or embedded systems.

  19. Interaction Diagrams Figure : Simple timing diagram

  20. Interaction Diagrams Figure : Timing diagram with tick marks

  21. Interaction Diagrams Figure : Timing diagram with time constraints

  22. Interaction Diagrams Figure : Timing diagram with multiple lifelines and messages

  23. Interaction Diagrams Figure : Timing diagram using a simpler timeline notation

  24. Communication diagrams • In UML 2.0 communication diag. is a simplified version of UML 1.x collaboration diag. • 4 –type of interaction diag.: • Sequence diagram • Communication diagram • Interaction overview diagram • Timing diagram • Model interaction between object • Communication diag. represent combination of info. Taken from class, sequence, use case diag. describing both static & dynamic behavior of system • It shows message flow between objects in OO application & also imply basic association between classes

  25. State chart Diagram

  26. State chart Diagram • UML has two types of state machines: • Behavioral state machines • Show the behavior of model elements such as objects. • A behavioral state machine represents a specific implementation of an element. • Protocol state machines • Show the behavior of a protocol. • Protocol state machines show how participants may trigger changesin a protocol's state and the corresponding changes in the system (i.e. The new state of the protocol).

  27. Behavioral State Machines You can model the behavior of the classifier using states, pseudostates, activities and transitions .

  28. Protocol State Machines

  29. States • States model a specific moment in the behavior of a classifier. This moment in time is defined by some condition being true in the classifier. • A state is shown as a rectangle with rounded corners. The name of the state is written inside the rectangle. Figure A simple state • A state name may be placed outside of the rectangle in a tab notation when showing composite or submachine states Figure : A state with its name in a tab

  30. Within the rectangle a state can be divided into compartments as needed. UML defines the following compartments: Figure : A state with compartments

  31. UML defines three types of states: 1. Simple states • Simplest of all states, they have no substates. All the example states used so far in this section are simple states. 2. Composite states • Have one or more regions for substates. A composite state with two or more regions is called orthogonal . 3. Submachine states • Semantically equivalent to composite states, submachine states have substates that are contained within a substate machine . Unlike composite states, submachine states are intended to group states, so you can reuse them.

  32. Composite States Figure : A composite state with Figure: Composite state with one region composite icon

  33. Regions • A region is shown using a dashed line dividing the decompositioncompartment. You may name each region by writing its name within the region's area. • Figure shows a composite state with two regions.

  34. Submachine state • A submachine state is shown in the same rounded rectangle as any other state, except you show the name of the state, followed by a colon (:) followed by the name of the referenced submachine. • Figure shows a submachine state.

  35. Transitions • A transition shows the relationship, or path, between two states or pseudostates. • It represents the actual change in the configurationof a state machine as it heads from one state to the next. • Transitions are shown as a line between two states, with an arrowhead pointing to the destination state.

  36. Transitions • When the action or activity of a state completes, flow of controlpasses immediately to the next action or activity state. • You specify this flow by using transitions to show the path from one action or activity state to the next action or activity state. In the UML, you represent a transition as a simple directed line, as Figure shows. • Trigger less transitions may have guard conditions, meaning that such a transition will fire only if that condition is met;

  37. trigger [guard] / effect where: • Trigger • Indicates what conditionmay cause this transition to occur. The trigger is typically the name of an event, though it may be more complex. • Guard • Is a constraint that is evaluated when an event is fired by the state machine to determine if the transition should be enabled. Guards should not have any side effects and must evaluate to a Boolean. Guards will always be evaluated before a transition is fired. • Effect • Specifies an activity that is executed when a transition happens. This activity can be written using operations, attributes, and links of the owning classifier as well as any parameters of the triggering event. An effect activity may explicitly generate events such as sending signals or invoking operations.

More Related