Week 12: Activity & Sequence Diagrams

Slides:



Advertisements
Similar presentations
© 2005 by Prentice Hall Appendix 3 Object-Oriented Analysis and Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George.
Advertisements

ESE Einführung in Software Engineering 7. Modeling Behaviour Prof. O. Nierstrasz.
UML (Sequence Diagrams, Collaboration and State Chart Diagrams) Presentation By - SANDEEP REDDY CHEEDEPUDI (Student No: ) - VISHNU CHANDRADAS (Student.
Introduction to Software Engineering 7. Modeling Behaviour.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Software Engineering COMP 201
Chapter 15: System Modeling with UML
SE 555 Software Requirements & Specification 1 Activity Diagrams.
THE OBJECT-ORIENTED DESIGN WORKFLOW UML2 Sequence Diagrams.
Essentials of interaction diagrams Lecture 23 & 24.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
SE-565 Software System Requirements More UML Diagrams.
Unified Modeling Language
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
1 Devon M. Simmonds University of North Carolina, Wilmington CSC450 Software Engineering WorkFlow Modeling with Activity Diagrams.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 15 System Modeling with the UML.
Activity diagrams. Introduction ● Activity diagrams are a behavioural model that represent the dynamics of the system. ● An activity diagram is essentially.
9-1 © Prentice Hall, 2004 Chapter 9: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
9-1 © Prentice Hall, 2007 Chapter 9: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
 C-style pointer-based arrays  Have great potential for errors and several shortcomings  C++ does not check whether subscripts fall outside the range.
Information Systems Engineering Interaction Diagrams: Sequence Diagram Collbortion Diagram.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Drawing System Sequence Diagrams
Interaction Diagrams Interaction Diagrams allow the designer to show how groups of objects collaborate in some behavior. –Interaction Diagrams will show.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour UML Sequence Diagram.
Sequence Diagrams CSIS3600. Sequence Diagrams A sequence diagram shows an interaction arranged in time sequence. In particular, it shows the objects participating.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
 Building Block Building Block  Things in the UML Things in the UML  Structural Things Structural Things  Behavioral Things Behavioral Things  Grouping.
7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
Chapter 3: Introducing the UML
Analysis Classes. What Is an Analysis Class?  A class that represents initial data and behavior requirements, and whose software and hardware-oriented.
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
Introduction to UML.
Systems Analysis and Design in a Changing World, Fourth Edition
Business Process and Functional Modeling
Appendix 3 Object-Oriented Analysis and Design
Analysis Classes Unit 5.
Activity Diagrams.
UML Diagrams By Daniel Damaris Novarianto S..
Unified Modeling Language Tutorial
Jim Fawcett CSE681 – Software Modeling and Analysis Fall 2017
Week 11: UML Overview IFS410: UML Models Spring 2007
Interactions.
Collaboration Diagrams
Unified Modeling Language (UML)
Evolution of UML.
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Dynamic Modeling of Banking System Case Study - II
Object-Oriented Systems Analysis and Design Using UML
Sequence and Collaboration Diagrams
Communication DIAGRAM
Activity and State Transition Diagram
Visit for more Learning Resources
Business System Development
UML dynamic Modeling (Behavior Diagram)
UML Activity Diagrams.
Software Engineering Chapter 5 (Part 3) System Modeling Dr.Doaa Sami.
Sequence Diagrams.
Princess Nourah bint Abdulrahman University
Object Oriented Analysis and Design
Princess Nourah bint Abdulrahman University
CIS 375 Bruce R. Maxim UM-Dearborn
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
Communication DIAGRAM
CIS 375 Bruce R. Maxim UM-Dearborn
Appendix 3 Object-Oriented Analysis and Design
Behavioral Diagrams P. P. Mahale
Presentation transcript:

Week 12: Activity & Sequence Diagrams MSIS 670: UML Models Week 12: Activity & Sequence Diagrams Activity Diagram Communication (Collaboration) diagram Sequence Diagram 11/29/2018

UML Techniques for OO Design Activity Diagram Communication (Collaboration) Diagram Sequence Diagram Package, Component, Deployment Diagrams 11/29/2018

Activity Diagrams Shows the conditional logic for the sequence of system activities needed to accomplish a business process Clearly shows parallel and alternative behaviors Can be used to show the logic of a use case An Activity diagram is a UML diagram that shows all of the flows of events for a use case in one place. To accomplish this, activity diagrams show different activities that the system performs and how different results cause the system to take different paths. Also, sometimes, it depicts the activities required to be performed in different places (e.g., departments). 11/29/2018

Activity Diagram Focus on system behavior Model an object’s workflow during program execution Model the actions the object will perform and in what order UML representation Action state ( rectangle with its left and right sides replaced by arcs curving outwards) Action order ( arrow with a stick arrowhead) Initial state (solid circle) Final state (solid circle enclosed in an open circle) For many people looking at the latest version of the UML, the most unfamiliar diagram is the new activity diagram. This is particularly unfamiliar since it is a diagram that was not present in works of either Booch, Jacobson, or Rumbaugh. In fact it is based upon the event diagram of Odell, although the notation is very different to that in Odell's books. The activity diagram focuses on activities, chunks of process that may or may not correspond to methods or member functions, and the sequencing of these activities. In this sense it is like a flow chart. It differs, however, from a flow chart in that it explicitly supports parallel activities and their synchronization. In the diagram above we see the find class activity triggers both the check prerequisite and the check permission activities. Indeed these checks will be done for each of the classes entered if required. Thus, if there are three classes that require prerequisite checks, there will be three threads on these activities. These threads, together with other threads without prerequisite nor permission started by the find class activity, are synchronized before the registration is dispatched. Action states: Action states represent the noninterruptible actions of objects. Action Flow: Action flow arrows illustrate the relationships among action states. 11/29/2018

Components of Activity Diagram Each activity represents a particular state within the execution of the encompassing method. Activities are linked by automatic transitions, represented by arrows, in the same way as transitions within statechart diagrams. When an activity terminates, the transition is triggered and the next activity starts. UML defines an optional stereotype for displaying decisions. A decision is represented by a diamond with many transitions coming out of it. The diagram below is equivalent to the last one, except for the fact that the decision is shown explicitly. Activity diagrams show synchronizations between control flows by using synchronization bars. A synchronization bar makes it possible to open and close parallel branches within the flow of execution of a method or a use case. The transitions pertaining to the start of a synchronization bar are triggered simultaneously. 11/29/2018

Fig. 5.30 | Activity diagram for a BalanceInquiry object. 11/29/2018

Fig. 5.31 | Activity diagram for a withdrawal transaction. How to draw Activity Diagrams 1. Identify the scope of the activity diagram Begin by identifying what it is you are modeling. Is it a single use case? A portion of a use case? A business process that includes several use cases? A single method of a class? Once you identify the scope of your diagram, you should add a label at the top, using a note, indicating an appropriate title for the diagram and a unique identifier for it. You may also want to include the date and even the names of the authors of the diagram. 2. Add start and end points Every activity diagram has a starting point and an ending point, so you might as well add them right away. 3. Add activities If you are modeling a use case, introduce an activity for each major step initiated by an actor (this activity would include the initial step, plus any steps describing the response of the system to the initial step). 4. Add decision points Sometimes the logic of what you are modeling calls for a decision to be made. Perhaps something needs to be inspected or compared to something else. Important to note is that the use of decision points is optional. 5. Identify opportunities for parallel activities Two activities can occur in parallel when no direct relationship exists between them and they must both finish before a third activity can. Fig. 5.31 | Activity diagram for a withdrawal transaction. 11/29/2018

When to Use Activity Diagrams Activity diagrams are useful when you want to describe a behavior which is parallel, or when you want to show how behaviors in several use-cases interact. Use Communication diagrams when you want to show how objects collaborate to implement an activity diagram. Use a state (chart) diagram to show how one object (attribute) changes during its lifetime. Activity diagram is used to understand the each of the use case in more detail. From here, we start thinking about “objects” used in each of the activities described in the diagram. It continues to collaboration diagram and sequence diagram (both are called interaction diagrams). The interaction diagrams show a number of example objects and the messages that are passed between these objects within the use-case. 11/29/2018

Interaction Diagrams Model interactions use UML Communication diagrams Also called collaboration diagrams Emphasize which objects participate in collaborations Sequence diagrams Emphasize when messages are sent between objects Interaction diagrams are models that describe how a group of objects collaborate in some behavior - typically a single use-case. Interaction diagrams come in two forms, both present in the UML: Sequence diagram and communication (collaboration) diagram Sequence diagram: objects are shown as vertical lines with the messages as horizontal lines between them. This form was first popularized by Jacobson. 11/29/2018

A communication diagram Objects Modeled as rectangles Contain names in the form objectName : className Objects are connected with solid lines Messages are passed alone these lines in the direction shown by arrows Name of message appears next to the arrow Fig. 7.26 | Communication diagram of the ATM executing a balance inquiry. 11/29/2018

Sequence diagrams Help model the timing of collaborations Lifeline Dotted line extending down from an object’s rectangle Represents the progression of time Activation Thin vertical rectangle Indicates that an object is executing Creating a Sequence Diagram Select a use case: A use case describes the steps in a business process. In this sense, an activity diagram may be used for the basis for this diagram. Add the actor, UI objects, and use case text: Each use case is carried out by an actor (signifying a specific type of user). This step simply involves adding the appropriate actor and a UI class to the sequence diagram, as shown in Figure 2. Select Objects/Classes to Carry out the System Response: When choosing the classes that carry out the system response, you need to examine each step of the use case and add the appropriate objects/classes to the diagram. This may take a bit of thought, because it may not be readily apparent which class you should choose to carry out each responsibility. If you have created the collaboration diagram, it is a good source of information. Add Messages between Objects: This step involves adding messages between objects to carry out each step of the use case. This includes both message calls and, optionally, return values 11/29/2018

Fig. 7.28 | Sequence diagram that models a Withdrawal executing. A Sequence Diagram Fig. 7.28 | Sequence diagram that models a Withdrawal executing. Sequence Diagram (Visio 2002) 11/29/2018

Elements in Sequence Diagrams Objects: Objects that are involved in the sequence of events you are documenting should be placed at the top of the sequence diagram across its horizontal axis. Sometimes, it's a good idea to place the actor that initiates a particular sequence at the upper left side of the diagram (not in this figure). You can also place a "UI" (user interface) placeholder class on the diagram with which the actor interacts. This is an excellent tool for providing context for a use case. Next, you can place objects on the diagram that are instantiated by the UI or by other objects. You should place the most important objects to the left and subordinate objects to the right. It's best to place objects on the diagram in a way that minimizes lines that cross. Lifelines: The lifeline is the dotted line that extends down the vertical axis from the base of each object. The lifeline indicates the life span of an object over a period of time. Messages: Messages are the most important elements of a sequence diagram. They indicate when one object calls an operation on another object (or itself). They are also used to indicate return values. Message flow begins at the top left object (which is usually an actor or UI) and flows down the vertical axis from one object to another. Messages are shown on UML diagrams as labeled arrows, with the arrowhead indicating the direction of the call. When a message is sent to an object, the text associated with the message specifies the name of the method that is being called on the receiving object. For example, in the figure above, the prepare() message is sent to the “:Order" object. This indicates that the Order object has a method named “prepare()." 11/29/2018

Creating a Sequence Diagram As mentioned previously, you often create a sequence diagram to model the logic of a use case. Figure above modeling the logic of a “logging-in” use case demonstrates the basic elements of sequence diagram. 11/29/2018