The Unified Modeling Language (UML)

Slides:



Advertisements
Similar presentations
Karolina Muszyńska Based on:
Advertisements

A Brief Introduction. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 04. Other.
CS3773 Software Engineering Lecture 03 UML Use Cases.
Object-Oriented Analysis and Design
Introduction To System Analysis and Design
Use-case Modeling.
Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.
L4-1-S1 UML Overview © M.E. Fayad SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I.
The Unified Software Development Process - Workflows Ivar Jacobson, Grady Booch, James Rumbaugh Addison Wesley, 1999.
SE 555 Software Requirements & Specification1 Use-Case Modeling: Overview and Context.
Jerry Gao Ph.D.9/2001 The UML: Object-Oriented Modeling The Unified Modeling Language (UML) Instructor: Jerry Gao Ph.D. San Jose State University
Lecture 11: Chapter 22 Topics –Object Oriented Modeling –UML –Use case.
© Copyright Eliyahu Brutman Programming Techniques Course.
Unified Modeling Language 7/12/2015B.Ramamurthy1 The Unified Modeling Language™ (UML) was developed jointly by Grady Booch, Ivar Jacobson, and Jim Rumbaugh.
An Introduction to Rational Rose Real-Time
Unified Modeling Language
Unified Modeling Language(UML) BY
UML and its Use-Case Modeling Professor Chen School of Business Gonzaga University Spokane, WA 99258
Introduction to UML 1 Quick Tour Why do we model? What is the UML? Foundation elements Unifying concepts Language architecture Relation to other OMG technologies.
CIT UPES | Sept 2013 | Unified Modeling Language - UML.
Prepared by: Sanaz Helmi Hoda Akbari Zahra Ahmadi Sharif University of Tech. Summer 2006 An Introduction to.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Unified Modeling Language, Version 2.0
1 SYS366 Lecture Visual Modeling and Business Use Case Diagrams.
Lecture 3: Visual Modeling & UML 1. 2 Copyright © 1997 by Rational Software Corporation Computer System Business Process Order Item Ship via “ Modeling.
UML Diagrams: Sequence Diagrams The Requirements Model, and The Dynamic Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical.
1 Object Oriented Analysis and Design with UML UNIT 3.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
1 Devon M. Simmonds University of North Carolina, Wilmington CSC450 Software Engineering WorkFlow Modeling with Activity Diagrams.
UML diagrams What is UML UML diagrams –Static modeoing –Dynamic modeling 1.
Unified Modeling Language* Keng Siau University of Nebraska-Lincoln *Adapted from “Software Architecture and the UML” by Grady Booch.
L6-S1 UML Overview 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College.
Copyright © 2013 Curt Hill UML Unified Modeling Language.
TAL7011 – Lecture 4 UML for Architecture Modeling.
2 2009/10 Object Oriented Technology 1 Topic 2: Introduction to Object-Oriented Approach Reference: u Ch.16 Current Trends in System Development (Satzinger:
Business Analysis with For PG MDI, Gurgaon Kamna Malik, Ph.D.
UML as a Specification Language for Embedded Systems. By, Mir Ahmed Ali, Asst. Professor, ECM department, SNIST. By, Prof. Narsiah sir, Director of School.
SWT - Diagrammatics Lecture 4/4 - Diagramming in OO Software Development - partB 4-May-2000.
Michael Schloh von Bennewitz 1. Oktober 2002 The Unified Modeling Language Overview of theory and practice of the OMG Unified Modeling.
Unified Modeling Language. Object Oriented Methods ► What are object-oriented (OO) methods?  OO methods provide a set of techniques for analyzing, decomposing,
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 15 The Unified Modeling Language: a Primer.
Lecture 9-1 : Intro. to UML (Unified Modeling Language)
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
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.
1 Unified Modeling Language, Version 2.0 Chapter 2.
UML Review of Use case diagrams. 2 Unified Modeling Language The Unified Modeling Language™ (UML) was developed jointly by Grady Booch, Ivar Jacobson,
Chapter 3: Introducing the UML
UML Course Instructor: Rizwana Noor. Overview  Modeling  What is UML?  Why UML?  UML Diagrams  Use Case  Components  Relationships  Notations.
1 BTS330 Visual Modeling. What is Visual Modeling? 2 Copyright © 1997 by Rational Software Corporation Computer System Business Process Order Item Ship.
1 SYS366 Week 2 - Lecture 2 Visual Modeling & UML.
Basic Characteristics of Object-Oriented Systems
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
Unified Modeling Language. What is UML? Standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems,
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 14 Slide 1 Object-Oriented Design.
UML (Unified Modeling Language)
UML AN OVERVIEW. Topics covered in this Session 1. Introducing UML. 2. What constitutes the UML. 3. Concepts of UML.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Use Cases UML. Use Cases What are Use Cases?  A statement of the functionality users expect and need, organized by functional units  Different from.
Introduction to UML.
UML Diagrams By Daniel Damaris Novarianto S..
Evolution of UML.
Object-Oriented Analysis and Design
Systems Analysis and Design With UML 2
Unified Modeling Language
University of Central Florida COP 3330 Object Oriented Programming
UML Diagrams Jung Woo.
Presentation transcript:

The Unified Modeling Language (UML) Instructor: Jerry Gao Ph.D. San Jose State University email: jerrygao@email.sjsu.edu URL: http://www.engr.sjsu.edu/gaojerry Sept., 2001

The Unified Modeling Language (UML) Presentation Outline - Introduction to UML - An Overview of UML - UML Notation - Use-Case Modeling - Modeling Classes, Objects, and Their Relationships - Dynamic Modeling - Advanced Dynamic Modeling: Real-Time Systems - Physical Architectures Jerry Gao Ph.D. 9/2001 All Rights Reserved

The Unified Modeling Language (UML) Introduction To UML What is UML? The UML is a modeling tool (or methodology) for software engineers and system analysts. It is designed to support all phases of software development, including - Requirements analysis and specification - Software design specification - Software code generation - Testing systems and modules in a black box view Why UML? - Software developments need consistent and standard modeling tool (or methods) to all phases of software development >- understandable, consistent, simple, and powerful - Too many methods Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Introduction To UML The goals of UML (stated by the designers): - To model systems using Object-Oriented Concepts - To establish an explicit coupling to conceptual as well as executable artifacts - To address the issue of scale inherent in complex, mission-critical systems - To create a modeling language usable by both humans and machines. Use of UML: (The UML has a broad spectrum of usage) - business modeling - software modeling in all phases of development for various systems Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Introduction To UML History of UML: - Grady Booch and James Rumbaugh at Rational Software Corp. Started the work on UML in 1994. In the initial work, they unite the Booch method and the MOT-2 method. - In 1995 systems, Ivar Jacobson (OOSE and Objectory methods) joined them. - Rational bought Objective System (the Swedish company) They started to work on UML to create a unified modeling method and tool Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Introduction To UML The Acceptance of UML: - During 1996, a number of companies and organizations joined Rational to form the UML Partners consortium. - 1997, many companies joined them: IBM, OCON, HP, DEC, Microsoft, Oracle, TI,…. - 1997 OMG has decide to use UML as their standard and is working on the final details of the specification. Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) The View of UML Component View Local View Use-Case View Deployment View Concurrency View Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) An Overview of UML Use-Case View: - Describe the functionality of the system from an external view - Focus on system function usage from the user point of view - Described in use-case diagrams - Used to support users, operators, designers, developers, and testers What are the system functions? Use-Case Diagrams External view Software Application System Jerry Gao Ph.D. 9/2001

Use-Case Diagram for An Insurance Business The Unified Modeling Language (UML) Use-Case Diagram for An Insurance Business Signing an insurance policy Sale statistics Insurance Salesperson Customer Customer statistics Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) An Overview of UML Logical View: - Describe how the system functionality is provided - Focus on internal logic structures and elements of the system - Provide diagrams to represent static structure & dynamic behaviors of the system - Used to support designers and developers How do they work? Static modeling diagrams Dynamic modeling diagrams internal view Software Application System Jerry Gao Ph.D. 9/2001

A Class Diagram for Financial Trading The Unified Modeling Language (UML) A Class Diagram for Financial Trading 1 Owns 1..* 1..* Handles 1 Customer Portfolio Trader 0..* Contains Contains 0..* Instrument Stock Option Bond Stock Jerry Gao Ph.D. 9/2001

A Class Diagram and An Object Diagram The Unified Modeling Language (UML) A Class Diagram and An Object Diagram Author Computer Uses 0..1 1..* Name:String age: integer Name:String memory: integer Class diagram Bob:Author Bob’s Job PC Computer Name:”Bob J.” age: 32 Object diagram Name:”Dell 466” memory: 64 Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) A State Diagram for An Elevator On first floor Go up(floor) Moving up Arrive at first floor Go up(floor) Moving to first floor Active at floor Arrive at floor Moving Down Idle Go down(floor) Time out Jerry Gao Ph.D. 9/2001

A Sequence Diagram For A Printer Server The Unified Modeling Language (UML) A Sequence Diagram For A Printer Server Print(file) :Computer :PrinterServer :Printer :Queue Print(file) [printer free] Print(file) [printer busy] Store(file) Jerry Gao Ph.D. 9/2001

A Collaboration Diagram For A Printer Server The Unified Modeling Language (UML) A Collaboration Diagram For A Printer Server :Queue :Computer [printer busy] 1.2:Store(file) 1:Print(file) [printer free]1.1:Print(file) :PrinterServer :Printer Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Component View of UML Component View: - Describe the implementation modules and their dependencies. - Focus on system structure at the component integration level - Provide component diagrams with component structures and dependencies - Used to support developers What is the system structure and component interactions? Component diagrams Component view Component Software Application System Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) An Activity Diagram Example Show MessageBox “Disk full” on Screen [Disk full] PrintFile() Show MessageBox “Print” on Screen [free disk space] Remove MessageBox ^Printer.Print(file) Create postscript file Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) A Component Diagram Example Window Handler (whnd.cpp) Window Handler (whnd.obj) Graphic lib (graphic.dll) Comm Handler (comhnd.cpp) Comm Handler (comhnd.obj) Client Program (client.exe) Main Class (main.cpp) Main Class (main.obj) Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) An Overview of UML Concurrency View: - View the system as processes and processors. - Focus on parallel execution, concurrent threads, their communications and synchronization - Provide dynamic diagrams and implementation diagrams - Designed for developers and integrators of the system What are processes? How do they interact? Implementation modeling diagrams Dynamic modeling diagrams Concurrency view process P1 P2 P3 Software Application System Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) An Overview of UML Deployment View: - Describe show the physical deployment of the system (or physical architecture) in terms of devices and computers - Focus on physical parts of the system and their connections - Provide deployment diagrams - Used to support developers, integrators, and testers What is the physical architecture? Deployment diagrams physical view Jerry Gao Ph.D. 9/2001

A Deployment Diagram (physical architecture) The Unified Modeling Language (UML) A Deployment Diagram (physical architecture) Client A: Compaq Pro PC Database Server VAX Application Server: Silicon Graphics O2 <<TCI/IP>> <<DecNet>> <<TCI/IP>> Client B: Compaq Pro PC Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) UML Notation - Model Elements Class Attributes Operations Object Attributes Operations State Node Interface Use case Component Package Note Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) UML Notation - Model Elements Association Dependency Generalization Aggregation Class anObject: Class Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) The Results of the UML Modeling Use-case Diagrams Class Diagrams State Diagrams Sequence Diagrams Collaboration Diagrams Activity Diagrams Component Diagrams Deployment Diagrams Common Repository Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) The UML: Use-Case Modeling Instructor: Jerry Gao Ph.D. San Jose State University email: jerrygao@email.sjsu.edu URL: http://www.engr.sjsu.edu/gaojerry Sept., 2001 Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Use-Case Modeling Use-Case Modeling: - use the use-case diagrams to describe a system - represent the functionality of the system - present a use-case view of the system - an iterative process The major components of a use-case model: - use cases, actors, and the system and relationships. - The functionality is represented by a number of use cases. - Each of them specifies a complete functional feature. Purpose of use cases: - to describe the functional requirements of the system - to provide a clear and consistent description of what the system do - to provide a basis for system tests - to make functional requirements traceable Jerry Gao Ph.D. 9/2001

Use-Case Diagram for An Insurance Business The Unified Modeling Language (UML) Use-Case Diagram for An Insurance Business Signing an insurance policy Sale statistics Insurance Salesperson Customer Customer statistics Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Use-Case Modeling How to perform use-case modeling? - Step #1: Finding actors. - An actor is someone interacting with the system. such as users, operators, or another system… - Actor is a type, not instance. - Step #2: Find the relationships between actors - Generalization relationship between actors (inheritance) - Step #3: Define use cases. - A use case represents a complete functionality of the system from an actor point’s of view - Step #4: Identify the relationships between use cases Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Use-Case Modeling Finding actors by asking the following questions: - Who will use the system? - Who will support and maintain the system? - Who will perform administration work for the system? - What other systems or (hardware) are interested the results from the system? - What other systems or (hardware) may generate input information or signals to the system? Jerry Gao Ph.D. 9/2001

Generalization between customer actors The Unified Modeling Language (UML) Generalization between customer actors Customer Personal Visitor Customer Telephone Customer Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Use-Case Modeling Characteristics of use cases: - A use case is always initiated by an actor. - A use case provides value to an actor. - A use case is complete. - Use cases are connected to actors through associations. Relationships between use cases: - Extends relationship: one use case extends another use case by adding actions to a general use case. - Use relationship: one use case uses another use case. - Grouping: a number of use cases handle similar functionality. Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Notations for Use Cases in UML System Name Use-case A Actor Name Use-case B Communication Association Use-case C Use-case name Jerry Gao Ph.D. 9/2001

Relationships Between Use Cases in UML The Unified Modeling Language (UML) Relationships Between Use Cases in UML Signing insurance policy Signing insurance policy <<Extends>> <<uses>> <<uses>> Signing Life Insurance Signing Car Purchase Insurance Signing Car Insurance Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Describing Use Cases The description of the use case is normally done through a text description. It also can be described through an activity diagram. It is about how the actors and the use cases interact. The description of a use case should include: - Objective for the use case - How the use case is initiated - The flow of messages between actors and the use case - Alternative flow in the use case - How the use case finishes with a value to the actor Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) A Use Case Example Jerry Gao Ph.D. 9/2001

An Activity Diagram Example The Unified Modeling Language (UML) An Activity Diagram Example Inserts coins into machine Check that enough coins have been inserted? Show that drink now can be chosen Show that drink is not available Chose drink [drink not available] [drink available] Deliver drink Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) The UML: Object-Oriented Modeling Instructor: Jerry Gao Ph.D. San Jose State University email: jerrygao@email.sjsu.edu URL: http://www.engr.sjsu.edu/gaojerry Sept., 2001 Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Object-Oriented Modeling Object-Oriented Modeling: - Focus on classes, objects and their relationships in the system - Represent the system using class diagrams and object diagrams - Is an iterative process The major elements of the object-oriented modeling: - classes, objects and their relationships. Purpose of object-oriented modeling: - to describe the system in terms of classes and objects - to provide a complete object-oriented view of the system - to help the understanding of the system through object-oriented analysis and modeling Jerry Gao Ph.D. 9/2001

A Class Diagram and An Object Diagram The Unified Modeling Language (UML) A Class Diagram and An Object Diagram Author Computer Uses 0..1 1..* Name:String age: integer Name:String memory: integer Class diagram Bob:Author Bob’s Job PC Computer Name:”Bob J.” age: 32 Object diagram Name:”Dell 466” memory: 64 Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Object-Oriented Modeling How to perform object-oriented modeling? - Step #1: Identify classes and objects in the system. - Find classes in the system - Identify their names and attributes - Identify their operations or functions - Step #2: Find the relationships between classes - Find association relationships between classes - Find aggregation relationships between classes - Find inheritance (generalization) relationship between classes - Define the roles and cardinality of each class in the relationships. - Step #3: Generate object diagrams based class diagrams Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Finding Classes Finding classes by asking the following questions: - Do we have information that should be stored or analyzed? If so, check information-oriented classes. such as input/output - Do we have external systems? If so, check the interface classes. - Do we use any components, libraries? If so, check component-oriented classes and library-oriented classes. - Do we have any customers or users? If so, check user-oriented classes. - Do we handle any devices? If so, check hardware-oriented interface classes. - Do we have any business structure or organization involved in the system? If so, find organization-oriented classes. Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Class Examples attributes Student Figure Name:String age: integer SS#: String GPA: float ReadStudent(); UpdateStudent(); CreateStudent(); PrintStudent(); Size: Size position: Position Type: FigureType draw(); setFiguer(); scaleFigure(); returnPosition(); operations Jerry Gao Ph.D. 9/2001

Association Relationship Between Classes The Unified Modeling Language (UML) Association Relationship Between Classes Student Computer Owns Student 1..* 0..* Computer Owns Multiplicity: default one-to-one 0..1 zero-to-one 0..* or * zero-to-many 1..* one-to-many Jerry Gao Ph.D. 9/2001

Roles in Association Relationship Between Classes The Unified Modeling Language (UML) Roles in Association Relationship Between Classes Person role wife husband married to A husband is married to a wife. Both husband and wife are people. If a person is not married, then he or she cannot play the role of husband or wife, which means the married to association is not applicable. drives * * Person Car company car driver A person plays the role of a driver, and a car plays the role of a company car the relationship. Jerry Gao Ph.D. 9/2001

Aggregation Relationship Between Classes The Unified Modeling Language (UML) Aggregation Relationship Between Classes * * Normal Aggregation Navy Warship Contains Shared Aggregation Team * * Person members A team is composed of team members. One person could be a member of many teams. Jerry Gao Ph.D. 9/2001

Aggregation Relationship Between Classes The Unified Modeling Language (UML) Aggregation Relationship Between Classes text Composition Aggregation * listbox * window button contains * menu * Jerry Gao Ph.D. 9/2001

Generalization Relationship Between Classes The Unified Modeling Language (UML) Generalization Relationship Between Classes Normal Generalization -> Inheritance Student Student Part-time Student Full-time Student Part-time Student Full-time Student Jerry Gao Ph.D. 9/2001

A Class Diagram for Financial Trading The Unified Modeling Language (UML) A Class Diagram for Financial Trading 1 Owns 1..* 1..* Handles 1 Customer Portfolio Trader 0..* Contains Contains 0..* Instrument Stock Option Bond Stock Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Packages dependency Subsystem D Subsystem A Subsystem B Subsystem C Subsystem E Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Packages Subsystem A Subsystem B Subsystem C Subsystem D Subsystem E Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) The UML: Dynamic Modeling Instructor: Jerry Gao Ph.D. San Jose State University email: jerrygao@email.sjsu.edu URL: http://www.engr.sjsu.edu/gaojerry Sept., 2001 Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) Dynamic Modeling Dynamic Modeling: - Focus on dynamic behaviors in the system - Use state, sequence, collaboration, and activity diagrams to present the behaviors of the system - Demonstrate how the objects interact dynamically The results of dynamic modeling: - State diagrams: -> describing object states and their changes in terms of events. - Sequence diagrams: -> describing how objects interact and communicate with each other. - Collaboration diagrams: -> describing how objects collaborate together by interactions - Activity diagrams: -> another shows the object interactions for functionality and actors. Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) The Notation of State Diagram Event State State starting point end point State Name State Vars Activities Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) A State Diagram for An Elevator On first floor Go up(floor) Moving up Arrive at first floor Go up(floor) Moving to first floor Active at floor Arrive at floor Moving Down Idle Go down(floor) Time out Jerry Gao Ph.D. 9/2001

The Unified Modeling Language (UML) A State Diagram for An Elevator Moving up do/moving to floor On first floor Go up(floor) Arrive at first floor Go up(floor) Active at floor Moving to first floor Idle timer = 0 do/increase timer Moving down do/moving to floor Arrive at floor Go down(floor) [Timer = time out] Guard-condition Jerry Gao Ph.D. 9/2001

Dynamic Modeling Instructor: Jerry Gao Ph.D. San Jose State University email: jerrygao@email.sjsu.edu URL: http://www.engr.sjsu.edu/gaojerry Sept., 2001

Topic: The Unified Modeling Language Sending Messages between State Diagrams Remote control On() Off On Off() Stop() Play() Off() On() Play() Stop() CD Player On() Play() Off On/Stop On/Play Off() Stop() Off()/Stop() Jerry Gao Ph.D. 9/2001 All Rights Reserved

Topic: The Unified Modeling Language An And-Substates Example concurrent substates Running Forward Backward Low Speed High Speed Jerry Gao Ph.D. 9/2001 All Rights Reserved

Sequence Diagram Instructor: Jerry Gao Ph.D. San Jose State University email: jerrygao@email.sjsu.edu URL: http://www.engr.sjsu.edu/gaojerry Sept., 2001

Sequence Diagram Sequence diagrams: - illustrate how objects interact with each other. - focus on interacting message sequences between objects Simple message :ObjectName Synchronous message Activation [Guard-condition] Return lifeline

Sequence Diagram Example Guard-condition Print(ps-file) :Computer :PrinterServer :Printer Print(ps-file) [no queue] Print(ps-file) simple message Object Synchronous message Activation Return lifeline

Sequence Diagram Example Print(file) :Computer :PrinterServer :Printer :Queue Print(file) [printer free] Print(file) [printer busy] Store(file)

Collaboration Diagram Instructor: Jerry Gao Ph.D. San Jose State University email: jerrygao@email.sjsu.edu URL: http://www.engr.sjsu.edu/gaojerry Sept., 2001

Collaboration Diagram Collaboration diagrams: - illustrate the interactions of objects. - focus on space instead of time. Applications: - may be used to show the execution of an operation - may be used to show a use-case execution - simply an interaction scenario in the system

Collaboration Diagram Oper() Object name: class Oper() The Oper( ) operation call itself.

Sequence Diagram Example Print(ps-file) :Computer 1:Print(ps-file) [printer free] 1.1:Print(ps-file) :PrinterServer :Printer

Collaboration Diagram Example NewCustomer() [free memory] 1:Create() :Customer{new} :MainWindow {parameter} 3:Show(Customer) 2:Create() 3:Update(data) :CustomerWindow {transient}

Collaboration Diagram Example 2: nextjob=GetJob() 1.1 *[all queues]:len = Length(){broadcast} 1.3:invoke(job) :Queue :Elevator {parameter}job :Elevator control {local}nextjob :Order{new} 1:GetElevator(floorid) job 1.2: Create( ) Push( ) :Button

Activity Diagram Instructor: Jerry Gao Ph.D. San Jose State University email: jerrygao@email.sjsu.edu URL: http://www.engr.sjsu.edu/gaojerry Sept., 2001

Activity Diagram Activity diagrams: - focus on work performed in the implementation of an operation and activities in a use-case instance or in an object - capture actions and results in terms of object state changes. Activity diagrams are used for different purposes: - to capture the work that will be performed when an operation is executing. - to capture the internal work in an object. - to show how a set of related actions may be performed, and how they will affect objects around them. - to show an instance of a use-case may be performed in terms of actions and object state changes. - to show how a business works in terms of workers, workflows, organization, and objects.

Activity Diagram Example - Show a sequence of interactions Show MessageBox “Printing” on screen Create postscript file CustomerWindow.PrinterAllCustomers() Send postscript file to printer Remove MessageBox

Activity Diagram Example - Show a sequence of interactions Show MessageBox “Printing” on screen Create postscript file CustomerWindow.PrinterAllCustomers() Remove MessageBox ^Printer.Printer(file) Send-clause

Activity Diagram Example - Show a sequence of interactions [disk full] Show MessageBox “Disk full” on the screen CustomerWindow.PrinterAllCustomers() [free disk space] Show MessageBox “Printing” on screen ^Printer.Printer(file) Create postscript file Remove MessageBox Send-clause

Activity Diagram Example - Show a sequence of interactions Sampler.Run(channel, frequency) initiate Updating displayer Measuring Performing concurrent actions