Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 3,Activity Diagrams.

Slides:



Advertisements
Similar presentations
Software Design Process A Process is a set of related and (sequenced) tasks that transforms a set of input to a set of output. Inputs Outputs Design Process.
Advertisements

© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
A Brief Introduction. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
Chapter 2, Modeling with UML, Part 2
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Activity Diagrams [Arlow and Neustadt, 2005] CS 425 / 625 Seminar on Software Engineering University of Nevada, Reno Department of Computer Science & Engineering.
UML Activity Diagrams In UML an activity diagram is used to display the sequence of actions They show the workflow from start to finish Detail the many.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 5, Analysis: Dynamic Modeling.
SE 555 Software Requirements & Specification 1 Activity Diagrams.
Unified Modeling Language (UML) Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Bernd Bruegge & Allen Dutoit Object-Oriented Software Engineering: Conquering Complex and Changing Systems 1 Software Engineering September 5, 2001 Introduction.
Requirements Analysis Activity Diagrams b511.ppt © Copyright De Montfort University 2000 All Rights Reserved INFO2005 Requirements Analysis.
Unified Modeling Language (UML)
COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Introduction to Requirements Analysis Lecture.
Software Design Processes and Management
Unified Modeling Language
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
CS 325: Software Engineering March 3, 2015 Activity Modeling for Transformational Systems Trtansformational Systems UML Activity Diagrams.
Course information and deadline reminders
CIT UPES | Sept 2013 | Unified Modeling Language - UML.
Chapter 8: Modelling Interactions and Behaviour UML Activity Diagram
UML A CTIVITY D IAGRAMS 1 Dr. Hoang Huu Hanh, OST – Hue University hanh-at-hueuni.edu.vn.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 21. Review ANALYSIS PHASE (OBJECT ORIENTED DESIGN) Functional Modeling – Use case Diagram Description.
Chapter 2, Modeling with UML, Part 2
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML: Review Session (Optional)
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML: Review Session (Optional)
1 Devon M. Simmonds University of North Carolina, Wilmington CSC450 Software Engineering WorkFlow Modeling with Activity Diagrams.
Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 9-11/188-3, 1040 Vienna,
Activity diagrams. Introduction ● Activity diagrams are a behavioural model that represent the dynamics of the system. ● An activity diagram is essentially.
Copyright © 2013 Curt Hill UML Unified Modeling Language.
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Bernd Bruegge & Allen Dutoit Object-Oriented Software Engineering: Conquering Complex and Changing Systems 1 Software Engineering September 19, 2001 UML.
UML as a Specification Language for Embedded Systems. By, Mir Ahmed Ali, Asst. Professor, ECM department, SNIST. By, Prof. Narsiah sir, Director of School.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML Activity Diagrams.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
Chapter 11 Activity Diagrams. 2 “Activity diagrams are a technique to describe procedural logic, business processes, and work flows” - M. Fowler An activity.
Introduction to UML 임현승 강원대학교 Revised from the slides by Bernd Bruegge and Allen H. Dutoit for the book “Object-Oriented Software Engineering: Using UML,
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 15 The Unified Modeling Language: a Primer.
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Week 04 Object Oriented Analysis and Designing. What is a model? A model is quicker and easier to build A model can be used in simulations, to learn more.
Chapter 14: Activity Diagrams November 2015 [Arlow and Neustadt, 2005] CS 425/625 Senior Projects University of Nevada, Reno Department of Computer Science.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Procedural Activity Patrick Bailey Keith Vander Linden Calvin College.
CEN 5011 Advanced Software Engineering
 Activity diagram is basically a flow chart to represent the flow from one activity to another activity.
UML ACTIVITY DIAGRAM 1. Recap Formal Use Case diagram UML notation for use cases Examples 2.
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
1 Object Oriented Analysis System modeling = Functional modeling + Object modeling + Dynamic modeling Functional modeling = Use cases Object modeling =class.
SWE 214 (071) Introduction to UML Slide 1 Introduction to UML.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 14 Slide 1 Object-Oriented Design.
1 An Overview of UML. 2 The Unified Modeling Language UML is a graphical language used by software engineers to model software systems during development.
UML (Unified Modeling Language)
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML Activity Diagrams.
Introduction to UML.
Chapter 2, Modeling with UML
Evolution of UML.
Unified Modeling Language
Activity Diagram.
Introduction to Unified Modeling Language (UML)
Activity and State Transition Diagram
University of Central Florida COP 3330 Object Oriented Programming
Chapter 2, Modeling with UML
Chapter 8: Modelling Interactions and Behaviour UML Activity Diagram
UML Activity Diagrams.
UML Activity Diagrams & State Charts
Software Design Methodologies and Testing
Presentation transcript:

Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 3,Activity Diagrams

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 2 What is UML? UML (Unified Modeling Language) Nonproprietary standard for modeling software systems, OMG Convergence of notations used in object-oriented methods OMT (James Rumbaugh and collegues) Booch (Grady Booch) OOSE (Ivar Jacobson) Current Version: UML 2.2 Information at the OMG portal Commercial tools: Rational (IBM),Together (Borland), Visual Architect (business processes, BCD) Open Source tools: ArgoUML, StarUML, Umbrello, LucidChart Commercial and Opensource: PoseidonUML (Gentleware)

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 3 What is UML? Unified Modeling Language Convergence of different notations used in object-oriented methods, mainly OMT (James Rumbaugh and collegues), OOSE (Ivar Jacobson), Booch (Grady Booch) They also developed the Rational Unified Process, which became the Unified Process in year at GE Research, where he developed OMT, joined (IBM) Rational in 1994, CASE tool OMTool At Ericsson until 1994, developed use cases and the CASE tool Objectory, at IBM Rational since 1995, Developed the Booch method (“clouds”), ACM Fellow 1995, and IBM Fellow com/

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 4 UML: First Pass You can model 80% of most problems by using about 20% UML We teach you those 20% rule: Pareto principle: For many events, roughly 80% of the effects come from 20% of the causes. Vilfredo Pareto, Introduced the concept of Pareto Efficiency, Founder of the field of microeconomics.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 5 UML Core Conventions All UML Diagrams denote graphs of nodes and edges Nodes are entities and drawn as rectangles or ovals Rectangles denote classes or instances Ovals denote functions Names of Classes are not underlined SimpleWatch Firefighter Names of Instances are underlined myWatch:SimpleWatch Joe:Firefighter An edge between two nodes denotes a relationship between the corresponding entities

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 6 Outline of this Class Activity diagrams Describe the dynamic behavior of a system, in particular the workflow. Class diagrams Describe the static structure of the system: Objects, attributes, associations Use case diagrams Describe the functional behavior of the system as seen by the user Sequence diagrams Describe the dynamic behavior between objects of the system Statechart diagrams Describe the dynamic behavior of an individual object

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 7 UML Activity Diagrams: Activities and Actions An activity is a non-atomic task or procedure decomposable into actions. An action is a task or procedure that cannot be broken into parts. An activity is a non-atomic task or procedure decomposable into actions. An action is a task or procedure that cannot be broken into parts. Actions and activities can be anything that humans, machines, organizations, or other entitites do.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 8 Activity Graph Elements activity symbol action node activity edge initial node activity final node

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 9 UML Activity Diagrams An activity diagram is a special case of a state chart diagram The states are activities (“functions”) An activity diagram is useful to depict the workflow in a system.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 10 Branching Nodes guards merge node decision node

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 11 Execution Model Execution is modeled by tokens that are produced by action nodes, travel over action edges, and are consumed by action nodes. When there is a token on every incoming edge of an action node, it consumes them and begins execution. When an action node completes execution, it produces tokens on each of its outgoing edges. An initial node produces a token on each outgoing edge when an activity begins. An activity final node consumes a token available on any incoming edge and terminates the activity.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 12 Branching Execution Decision and merge node behavior: If a token is made available on the incoming edge of a decision node, the token is made available on the outgoing edge whose guard is true. If a token is available on any incoming edge of a merge node, it is made available on its outgoing edge. Guards must be mutually exclusive.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 13 Deadlock RunDrier cannot execute: when the activity begins, there is a token on the edge from the initial node but not on the other incoming edge.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 14 Forking and Joining Nodes fork node join node

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 15 Forking and Joining Execution A token available on the incoming edge of a fork node is reproduced and made available on all its outgoing edges. When tokens are available on every incoming edge of a join node, a token is made available on its outgoing edge. Concurrency can be modeled without these nodes.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 16 Concurrent Problem Solution (An example)

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 17 Object Nodes Data and objects are shown as object nodes. object node object node state

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 18 Control and Data Flows Control tokens do not contain data, data tokens do. A control flow is an activity edge that is a conduit for control tokens. A data flow is an activity edge that is a conduit for data tokens. Rules for token flow through nodes apply to both control and data tokens, except that data is extracted from consumed tokens and added to produced tokens.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 19 Control and Data Flow Example control flow data flows

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 20 Activity Parameters Activity parameters are object nodes placed on activity symbol boundaries to indicate data or object inputs or outputs. Activity parameters contain the data or object name. Activity parameter types are specified in the activity symbol beneath the activity name.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 21 Activity Parameter Example: Maximum Finding Algorithm output activity parameter input activity parameter activity parameter types

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 22 Activity Diagram Heuristics Flow control and objects down the page and left to right. Name activities and actions with verb phrases. Name object nodes with noun phrases. Don’t use both control and data flows when a data flow alone can do the job. Make sure that all nodes entering an action node can provide tokens concurrently (to prevent deadlocks). Use the [else] guard at every branch.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 23 When to Use Activity Diagrams When making a dynamic model of any process. Design processes (what designers do) Designed processes (what designers create) During analysis During resolution

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 24 Activity Diagrams allow to model Decisions Decision

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 25 Activity Diagrams can model Concurrency Synchronization of multiple activities Splitting the flow of control into multiple threads Synchronization Splitting

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 26 Activity Diagrams: Grouping of Activities Activities may be grouped into swimlanes to denote the object or subsystem that implements the activities. Open Incident Allocate Resources Coordinate Resources Document Incident Archive Incident Dispatcher FieldOfficer

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 27 Activity Diagram vs. Statechart Diagram ActiveInactive Closed Archived Incident- Handled Incident- Documented Incident- Archived Statechart Diagram for Incident Focus on the set of attributes of a single abstraction (object, system) Activity Diagram for Incident (Focus on dataflow in a system) Triggerless transition Completion of activity causes state transition Event causes state transition

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 28 Example of an Activity Diagram with a Frame

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 29 The Activity Diagram without Frame

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 30 Activity Diagram Example Action Object node

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 31 Activity Diagram: Activity Nodes & Edges An activity diagram consists of nodes and edges There are three types of activity nodes Control nodes Executable nodes Most prominent: Action Object nodes E.g. a document An edge is a directed connection between nodes There are two types of edges Control flow edges Object flow edges

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 32 Activity Diagram Example Object flow Control flow

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 33 Summary: Activity Diagram Example Initial node Merge node Final node Action Object node Fork node Join node Object flow Control flow

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 34 Example 1: What the diagram represents? a.A document b.A printer c.A word- processor d.A user of a word-processor e.A page being printed f.The diagram is invalid

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 35 Example 2: What is the max number of concurrent threads that is possible? a.1 b.2 c.3 d.4 e.5

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java Example 3: In this diagram... a.Fill Order is executed before Receive Payment b.Overnight Delivery is executed in parallel with Regulary Delivery c.Close Order is executed after Receive Payment d.Fill Order is executed in parallel with Send Invoice e.Send Invoice is possibly executed f.Regular Delivery is always executed

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 37 Example 4:

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 38 Example 5: Cash Withdrawal Process from a Bank

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 39 Example 6: Passenger to Airplane There should be only one final node, not two!!!

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 40 Alıştırma (10 dakika) Müşteri restorana girer. Eğer oturacak yer varsa oturur, yoksa çıkar. Oturduktan sonra menüye bakar. İki seçeneği vardır: Çin yemeği, Japon yemeği. İkisini de yemek istemiyorsa çıkar gider. İstediği yemeği seçer, garsona söyler. Garson mutfağa siparişi geçer. Yemekler hazır olduğunda garson yemeği müşteriye götürür. Müşteri yemeği yedikten sonra hesap ister. Eğer memnun kaldıysa hesabı ödeyip bahşiş bırakır. Eğer memnun kalmadıysa hesabı öder, bahşiş bırakmadan restorandan çıkar.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 41 Summary A process is a collection of related tasks that transforms a set of inputs to a set of outputs. UML activity diagrams model processes by depicting actions and the flow of control and data between them. Activity symbols contain activity graphs consisting of action nodes action edges data nodes special nodes for starting and stopping activities, branching, forking, and joining Activity diagrams can represent any process and are useful throughout software design.

Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 42 Another view on UML Diagrams