Chapter 2, Modeling with UML: UML 2 Hightlights

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

1 CIS224 Software Projects: Software Engineering and Research Methods Lecture 11 Brief introduction to the UML Specification (Based on UML Superstructure.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML, Part 4 UML 2 Metamodel.
UML Diagrams Jung Woo. What is UML? Standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems, business.
© 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.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 04. Other.
Nicolò Carissimi in UML 2.0. Summary what’s behind UML: MDA UML 2.0 and MDA key concepts.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 5, Analysis: Dynamic Modeling.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Component and Deployment Diagrams
1 CS/CPE 426 Senior Projects Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 24, 2009.
© Copyright Eliyahu Brutman Programming Techniques Course.
SE-565 Software System Requirements More UML Diagrams.
Designing with Interaction and Design Class Diagrams Chapters 15 & 16 Applying UML and Patterns Craig Larman With some ideas from students in George Blank’s.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
CS3773 Software Engineering
Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 9-11/188-3, 1040 Vienna,
Chapter 5 – System Modeling
Systems Analysis and Design in a Changing World, 6th Edition
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 4, Requirements Elicitation.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 1 Object Modeling.
Chapter 2, Modeling with UML, Part 3 UML 2 Hightlights
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)
Systems Analysis and Design in a Changing World, 3rd Edition
UML diagrams What is UML UML diagrams –Static modeoing –Dynamic modeling 1.
1 Advanced Software Architecture Muhammad Bilal Bashir PhD Scholar (Computer Science) Mohammad Ali Jinnah University.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College.
1 Advanced Behavioral Model Part 1: Processes and Threads Part 2: Time and Space Chapter22~23 Speaker: 陳 奕 全 Real-time and Embedded System Lab 10 Oct.
What to remember from Chap 13 (Logical architecture)
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour UML Sequence Diagram.
University of Toronto at Scarborough © Bennett, McRobb and Farmer 2005 CSCC40 communication and sequence diagrams : listCampaigns *[For.
Object-Oriented Analysis and Design 1 Mira Balaban & Arnon Sturm Object-Oriented Analysis and Design Session 3a: Behavioral Modeling - Interactions.
1/26 On-demand Learning Series Software Engineering of Web Application - Object-Oriented Development & UML Hunan University, Software School.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 5 INTRODUCTION TO SYSTEMS ANALYSIS AND DESIGN: AN AGILE, ITERATIVE APPROACH CHAPTER.
Chapter 11 Activity Diagrams. 2 “Activity diagrams are a technique to describe procedural logic, business processes, and work flows” - M. Fowler An activity.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Lecture 9-1 : Intro. to UML (Unified Modeling Language)
Interaction Diagram An interaction diagram is a graphical representation of interactions between objects. Sequence diagram: shows the sequence in which.
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
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.
© Bennett, McRobb and Farmer Object Interaction – Sequence Diagrams Based on Chapter 9 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
Chapter 3: Introducing the UML
CSCI 3428: Software Engineering Tami Meredith UML Unified Modeling Language.
Identifying classes, Packages and drawing class Diagrams, Object Diagrams and composite structure diagrams Week 07 1.
UML Course Instructor: Rizwana Noor. Overview  Modeling  What is UML?  Why UML?  UML Diagrams  Use Case  Components  Relationships  Notations.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML: UML 2 Metamodel Note to Instructor: The material in this.
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
Two New UML Diagram Types Component Diagram Deployment Diagram.
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)
Sequence diagrams Lecture 5. Main terms  Interaction  Life line  Activation  Executable behavior and derived behavior  Messages  Trajectory  Frame.
UML Diagrams By Daniel Damaris Novarianto S..
COMPONENT & DEPLOYMENT DIAGRAMS
Object-Oriented Analysis and Design
Unified Modeling Language
UML Diagrams Jung Woo.
State Machine Diagrams
Business System Development
Software Engineering Chapter 5 (Part 3) System Modeling Dr.Doaa Sami.
UML Activity Diagrams & State Charts
CS/CPE 426 Senior Projects
CS/CPE 426 Senior Projects
CS 791Z State Machines & Advanced State Machines
Appendix 3 Object-Oriented Analysis and Design
Presentation transcript:

Chapter 2, Modeling with UML: UML 2 Hightlights

Outline for today UML 2: UML is a living language Overview of important changes in UML 2 Frames and nesting of Frames Activity diagrams Deployment diagrams Sequence diagrams Stereotypes

Recent History of UML March 2003: UML 1.5 July 2005: UML 2.0 November 2007: UML 2.1.2 February 2009 UML 2.2

UML now usable with Model Driven Architecture (MDA) Better support for the automatic transformation of a Platform Independent Model (PIM) into a Platform Specific Model (PSM) UML 2 is based on a meta model Meta Object Facility (MOF) If you are talking of UML as a model, then MOF is its meta model.

Changes in UML 2 Frames and nesting Changes in diagram notations Activity diagram Deployment diagram Sequence diagram New diagram types (Not covered in this lecture) Composite structure diagrams Timing diagrams

Frames: Notation for all UML 2 Diagrams Mandatory is now the contents area Optional: The contents area can be surrounded with frame and a heading Frame <heading> ::= [<diagram kind>]<name>[<parameters>]

Diagram Kinds Diagram Notation The following abbreviations are usually used for diagram frames: act (for activity frames) cmp (for component frames) sd (for interaction frames) pkg (for package frames) stm (for state machine frames) uc (for use case frames) Activity diagram Class diagram Component diagram Interaction diagram Package state machine diagram Use case diagram Why are interaction frames abbreviated with “sd”? Historical: sequence diagram

Nested Diagrams UML 2 supports nested diagrams e.g. an activity diagram can be inside a class The frame concept visually groups elements that belong to one diagram

Example of a Activity Diagram with a Frame

The Activity Diagram without Frame Initial Node (Control) Decision Node

UML Activity Diagrams 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

UML Activity Diagrams An activity diagram consists of nodes and edges There are three types of activity nodes Control nodes (special icon) Executable nodes (an oval) Most prominent: Action Object nodes E.g. a document (a rectangle) An edge is a directed connection between nodes There are two types of edges Control flow edges Object flow edges

Control Node Icons in an Activity Diagram Initial node Final node Activity final node Flow final node Fork node Join node Merge node Decision node

Activity Diagram Example Decision node Fork node Join node Merge node Initial node Initial Node (Control) Decision Node Final node

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

Action Nodes and Object Nodes Name Action Name Write Thesis Thesis ReviewThesis

Activity Diagram Example Initial Node (Control) Decision Node Action Object node

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

Activity Diagram Example Control flow edge Initial Node (Control) Decision Node Object flow edge

Summary: Activity Diagram Example Decision node Fork node Join node Merge node Initial node Control flow edge Initial Node (Control) Decision Node Final node Action Object node Object flow edge

Activity Diagram: Pins Write Thesis ReviewThesis Thesis Pin: Alternative notation for an object node Different notations with same semantics Write Thesis ReviewThesis Thesis Thesis Both notations define object flow in an activity.

Outline for today UML 2: UML is a living language Overview of important changes in UML 2 Frames and nesting Activity diagrams Deployment diagrams Sequence diagrams Stereotypes

UML 2 Deployment Diagrams Two node types: Device Execution environment

Deployment Diagram Changes II Artifacts can now manifest any packageable element, not just components Manifestation is shown by a dependency with keyword «manifest»

Deployment Diagram Changes III A deployment diagram can have a deployment specification

Diagram Kinds The following abbreviations are usually used for diagram frames: act (for activity frames) cmp (for component frames) sd (for interaction frames) pkg (for package frames) stm (for state machine frames) uc (for use case frames) Activity diagram Class diagram Component diagram Interaction diagram Package state machine diagram Use case diagram Why are interaction frames abbreviated with “sd”? Historical: sequence diagram

Interaction Diagrams New concept of interaction fragments Before we go into detail with interaction fragments, let’s cover the concept of an interaction.

Interaction Diagrams Four types of interaction diagrams: Sequence diagrams Communication diagrams Interaction overview diagrams Timing diagrams The basic building block of an interaction diagram is the interaction An interaction is a unit of behavior that focuses on the observable exchange of information between connectable elements

Interactions UML Interactions are primarily used during analysis to get a better understanding of the interactions between entity objects Interactions are also used during the detailed design activity (object design), especially if precise inter- process communication must be set up according to formal protocols Interactions can finally be used during testing to describe the desired behavior of a system to compare it with the observed behavior.

Example of an Interaction: Sequence Diagram

Explanation for the Previous Slide The sequence diagram on the previous slide shows three messages between two anonymous lifelines of type User and ACSystem: CodePin, CardOut and OK The CardOut message passes the OK message such that the event occurrences received by User are in the opposite order sent by the ACSystem. This type of communication can occur when the messages are asynchronous. A fourth message Unlock is sent from the ACSystem to the boundary of the sequence diagram Thus we assume the existence of a gate with the implicit name out_Unlock.

Interaction Fragment Interaction Fragment Combined Fragment Is a piece of an interaction Acts like an interaction itself Combined Fragment Is a subtype of interaction fragment defines an expression of interaction fragments An expression of interaction fragments is defined by an interaction operator and interaction operands.

Interaction Operators A combined fragment defines an expression of interaction fragments. The following operators are allowed in a combined fragment expression: alt opt par loop critical neg assert strict seq Ignore consider

Alt Operator The interaction operator alt indicates a choice of behavior between interaction fragments At most one interaction fragment (that is, an InteractionOperand) is chosen The chosen interaction fragment must have an explicit or implicit guard expression that evaluates to true at this point in the interaction A guard can be a boolean expression (called InteractionConstraint) else (a reserved word) If the fragment has no guard expression, true is implied.

Example of a Combined Fragment using alt

Opt and Break Operators option: The interaction operator opt designates a choice of behavior where either the (sole) operand happens or nothing happens. break: The interaction operator break represents a breaking scenario: The operand is a scenario that is performed instead of the remainder of the enclosing interaction fragment. A break operator with a guard is chosen when the guard is true When the guard of the break operand is false, the break operand is ignored and the rest of the enclosing interaction fragment is chosen. The choice between a break operand without a guard and the rest of the enclosing interaction fragment is done non-deterministically.

Parallel and Critical Operator The interaction operator par designates a parallel merge between the behaviors of the operands of a combined fragment. critical The interaction operator critical designates that the combined fragment represents a critical region. The event occurrences of the different operands can be interleaved in any way as long as the ordering imposed by each operand is preserved. A parallel merge defines a set of traces that describes all the ways that event occurrences of the operands may be interleaved. The traces of the region cannot be interleaved by other event occurrences (on the Lifelines covered by the region). This means that the region is treated atomically by the enclosing fragment.

Example of a Critical Region Problem statement: The telephone Operator must make sure to forward a 911-call from a Caller to the Emergency system before doing anything else. Normal calls can be freely interleaved. Don’t forget to point out that this is also an example for a use of the par fragment

One more thing: Modeling Real-Time Constraints The duration of a message and the duration between two event occurrences can be constrained with a time constraint.

Where are we? Introduction Frames and nesting Changes in diagram notation: Activity diagram Deployment diagram Sequence diagram Profiles and stereotypes

Stereotype Defines how an existing meta class may be extended More on meta classes and meta modeling in the next lecture (today or on Friday) Stereotype Defines how an existing meta class may be extended A meta class may be extended by one or more stereotypes Why do we want to do this? Example: Insertion of solution domain abstractions in the model (such as platform specific classes) Sterotypes allow a clear separation from the application domain abstractions. A Stereotype is like a Class that extends Classes through an extension.

Stereotype Notations A stereotype is a string enclosed in guillemets before the classifier name E.g. «Clock» StopWatch, «boundary» button Stereotypes can also be represented with a graphical icon The icon can even replace the standard notation (icons for a class, object, use case, etc). TODO: Griffige Formulierung finden, die den Unterschied verdeutlicht

Icons and Symbols for Stereotypes One can use icons or graphical symbols for stereotypes When the stereotype is applied to a UML model element, the graphic replaces the standard notation for the model element Example: Modeling a network, use icons for representing classes of type Switch, Server, Router, Printer Icon for Router class Icon for Switch class Icon for Server Class

Pros and Cons of Stereotype Graphics Advantages: UML diagrams may be easier to understand if they contain graphics and icons for stereotypes This can increase the readability of the diagram, especially if the client is not trained in UML And they are still UML diagrams! Disadvantages: If developers are unfamiliar with the symbols being used, it can become much harder to understand what is going on Especially in high level management presentations Additional symbols add to the burden of learning to read the diagrams If you end up applying stereotypes all over your model, you should think of defining a profile (see next lecture).

Stereotypes vs. Keywords Not to be mixed up with keywords Same notation (String enclosed in guillemets) «interface» is no stereotype! «extend» is no stereotype! See Annexes B and C of the UML Superstructure specification. TODO: Griffige Formulierung finden, die den Unterschied verdeutlicht

Additional Readings UML 2.2 specification The specification consists of two complementary parts which constitute the complete speciication of UML 2: Infrastructure and Superstructure. The infrastructure specification defines the foundational language constructs http://www.omg.org/spec/UML/2.2/Infrastructure/PDF The superstructure defines the user level constructs. http://www.omg.org/spec/UML/2.2/Superstructure/PDF For a complete list of all UML specifications, see http://www.omg.org/spec/UML/ Main source for lecture today: Specification