(14-2) UML Instructor - Andrew O’Fallon CptS 122 (December 2, 2015) Washington State University.

Slides:



Advertisements
Similar presentations
UML an overview.
Advertisements

System Sequence Diagrams
Karolina Muszyńska Based on:
ESE Einführung in Software Engineering 7. Modeling Behaviour Prof. O. Nierstrasz.
Introduction to Software Engineering 7. Modeling Behaviour.
Analysis and Design with UML
Use Case Diagram © copyright 2001 SNU OOPSLA Lab..
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
7M822 UML Sequence Diagrams 2 December 2010.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Interaction Models. Interaction Definition An interaction is a behavior that comprises a set of messages exchanged among a set of objects within a context.
Sequence Diagrams By Zvika Gutterman Adam Carmi. Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control Information Examples.
Sequence Diagrams By Zvika Gutterman Adam Carmi. Sequence Diagrams2 Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control.
© Copyright Eliyahu Brutman Programming Techniques Course.
SE-565 Software System Requirements More UML Diagrams.
Page 1 R Copyright © 1997 by Rational Software Corporation Analysis and Design with UML.
1 Lab Beginning Analysis and Design 4 Completion of first version of use case diagram initiates the processes of analysis and design. 4 UML provides.
Unified Modeling Language
SEQUENCE DIAGRAM Prepared by: T. Fatimah Alageel.
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
2.3 Examples: Ski resort information system
SOFTWARE ENGINEERING BIT-8 APRIL, 16,2008 Introduction to UML.
Page 1 What is the UML? UML stands for Unified Modeling Language The UML combines the best of the best from – Data Modeling concepts (Entity Relationship.
Introduction to the Unified Modeling Language “The act of drawing a diagram does not constitute analysis or design. … Still, having a well-defined and.
1 Behavioral diagrams (2) Lecture p5 T120B pavasario sem.
Page 1  Copyright © 1997 by Rational Software Corporation Computer System Business Process Order Item Ship via “ Modeling captures essential parts of.
Page 1 R Copyright © 1998 by Rational Software Corporation Visual Modeling and the UML.
4. UML. CPSC 333: Foundations of Software EngineeringJ. Denzinger 4.1. Motivation The Unified Modeling Language tries to integrate older approaches Developed.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 02. Objects,
Collaboration Diagrams CSIS3600. What is a Collaboration Diagram Collaboration diagrams illustrate interactions between objects The collaboration diagram.
An Introduction to the Unified Modeling Language
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
COP43311 Copyright © 1997 by Rational Software Corporation Unified Modeling Language (UML) Based on slides and papers from Rational’s UML website
© 2008 Prentice Hall, Ovidiu Noran Lecture 7b 1 Modelling OO Logic Requirements: Sequence Diagrams and Activity Diagrams (Textbook Chapter 8, Appendix)
1 The Unified Modeling Language. 2 The Unified Modeling Language (UML) is a standard language for writing software blueprints. The UML may be used to.
Business Analysis with For PG MDI, Gurgaon Kamna Malik, Ph.D.
Design Jon Walker. More UML ● What is UML again?
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
Page 1 R Copyright © 1997 by Rational Software Corporation Analysis and Design with UML Presentation was downloaded (and is available for free) from Rational.
Ch- 8. Class Diagrams Class diagrams are the most common diagram found in modeling object- oriented systems. Class diagrams are important not only for.
ITEC324 Principle of CS III Chapter 2 (Horstmann’s Book) – Part 1 The Object-Oriented Design Process Hwajung Lee.
Software Engineering Lecture 8 Object-Oriented Analysis.
Chapter 3: Introducing the UML
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
Page 1  Copyright © 1997 by Rational Software Corporation Putting the UML to Work The ESU University wants to computerize their registration system –
CS 501: Software Engineering Fall 1999 Lecture 15 Object-Oriented Design I.
Chapter 2 (Horstmann’s Book) – Part 1 The Object-Oriented Design Process Hwajung Lee.
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)
1 IS 0020 Program Design and Software Tools Unified Modeling Language Lecture 13 April 13, 2005.
1 IS 0020 Program Design and Software Tools Unified Modeling Language Lecture 13 November 30, 2004.
Sequence diagrams Lecture 5. Main terms  Interaction  Life line  Activation  Executable behavior and derived behavior  Messages  Trajectory  Frame.
Introduction to UML.
CompSci 280 S Introduction to Software Development
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Object-Oriented Analysis and Design
UML Modeling Sequence diagram
Unified Modeling Language
Introduction to Unified Modeling Language (UML)
Sequence Diagrams.
The Unified Modeling Language
UML: Unified Modeling Language
Week 12: Activity & Sequence Diagrams
CIS 375 Bruce R. Maxim UM-Dearborn
Unified Modelling Language
CIS 375 Bruce R. Maxim UM-Dearborn
ITEC324 Principle of CS III
Presentation transcript:

(14-2) UML Instructor - Andrew O’Fallon CptS 122 (December 2, 2015) Washington State University

A. O’Fallon, J. Hagemeister 2 UML as a Model UML is a notational syntax for expressing Object Oriented models Merges Booch, Rumbaugh, and Jacobson Not a methodology (although the Unified Process is) UML Models can (should be) an important source for test

A. O’Fallon, J. Hagemeister 3 Relationships in UML Models Relationships in models can show a dependency between two instances The example shows a relationship such that a student takes 0 to many classes; We might question the many (limiting it to some max value) but we can definitely look for tests about this relationship Student Class takes 0..* Built in relationships have a corresponding generic test requirements that can be identified by applying a relational test strategy to each UML diagram

A. O’Fallon, J. Hagemeister 4 General Purpose Elements of UML Organize diagrams Express details

A. O’Fallon, J. Hagemeister 5 Packages and Package Diagrams Package – A group of UML diagrams and diagram elements of any kind, including other packages A package diagram shows the organization of packages

A. O’Fallon, J. Hagemeister 6 Expressions, Constraints, Comments, and NOTES Expression  a string from an executable language that can be evaluated to produce a result Constraints  a predicate expression on an element Comments  a natural language constraint A note is a box with a dog eared corner. It may or may not be connected to a diagram element. It contains a textual description or explanation.

A. O’Fallon, J. Hagemeister 7 Use Case Models (1) Query weather&snow forecast Book room Book kids’ SB course Visitor Cancel course Book SB course Cancel room Enter personal info > ( Enter kid’s age) >

A. O’Fallon, J. Hagemeister 8 Use Case Models (2) Use Case: Book SB course Precond: - Main flow: 1. Visitor enters date 2. Include (Enter personal info) 3. (Enter kid’s age) 4. Store reservation 5. Confirm reservation to Visitor Exceptional flow: – If number of course participants for specified date > 8, then tell visitor so and let him choose another date

A. O’Fallon, J. Hagemeister 9 Use Case Models (3) Use Case: Book kids’ SB course Precond: SB course is for a kid Main flow: 1. Enter kid’s age 2. Store reservation 3. Confirm reservation to Visitor Exceptional flow: – If course for specified date is adult course, then tell visitor so and let him choose another date Exceptional flow: – If course for specified date is kids’ course, and the specified age is outside the course’s age range, then tell visitor so and let him choose another date

A. O’Fallon, J. Hagemeister 10 Use Case An abstraction of the system to model behavior to external interaction Accomplish important tasks from the user’s point of view Represent system requirements – Functional – Allocation to classes – Object interaction and interfacing – User interfaces – User documentation

A. O’Fallon, J. Hagemeister 11 Class Diagram Central for OO modeling Shows static structure of the system – Types of objects – Static relationships Association (e.g.: a company has many employees) Generalization (subtypes) (e.g.: an employee is a kind of person) Dependencies (Aggregation) (e.g.: a company is using trucks to ship products)

A. O’Fallon, J. Hagemeister 12 Class Set of objects Defines – Name – Attributes (optional: type optional: initial value) – Operations Task startDate: Date = default endDate: Date name setStartDate (d : Date) setEndDate (d : Date) getDuration () : Date

A. O’Fallon, J. Hagemeister 13 Class diagram example Light off( ) on( ) HeaterCooler Environmental Controller define_climate( ) terminate_climate( ) 0..* SystemLog display( ) recordEvent( ) Actuator startUp( ) shutDown( ) Temperature generalization aggregation association

A. O’Fallon, J. Hagemeister 14 Sequence Diagrams Shows object interactions arranged in time sequence It focuses on – Objects (and classes) – Message exchange to carry out the scenarios functionality The objects are organized in an horizontal line and the events in a vertical time line

A. O’Fallon, J. Hagemeister 15 Notation Example (simple version) Messages point from client to supplier : Professor CourseManager Math Section 1 : CourseOffering Add professor (Professor) LifelineMessage

A. O’Fallon, J. Hagemeister 16 Sequence Diagram: Larger Example course form : CourseForm theManager : CurriculumManager aCourse : Course : Registrar 1 : set course info 2 : process 3 : add course 4 : > Object creation

A. O’Fallon, J. Hagemeister 17 Sequence Diagrams: More Details an Order Entry window an Order Line a Stock Item 1: prepare() 2: * prepare() 3: check() 4: [check = true] remove() 5: needsToReorder() Iteration Condition Self delegation Asynchronous Message Activation a Reorder Item 6: [needsToReorder = true] > Return arrow

A. O’Fallon, J. Hagemeister 18 From: G. Booch, J.Rumbaugh, I. Jacobson: The Unified Modeling Language User Guide. Addison Wesley, 1999, fig 18-2 page 247 Example of a Transaction

A. O’Fallon, J. Hagemeister 19 Content of Sequence Diagrams Objects – They exchange messages among each other Messages – Synchronous: “call events,” denoted by the full arrow; Duration of synchronization should be indicated by activation bar or return arrow – Asynchronous: “signals,” denoted by a half arrow – There are also «create» and «destroy» messages

A. O’Fallon, J. Hagemeister 20 Asynchronous messages Do not block the caller Can do 3 things: – Create a new thread – Create a new object – Communicate with a thread that is already running

A. O’Fallon, J. Hagemeister 21 References Robert V. Binder, Testing Object-Oriented Systems: Models, Patterns, and Tools, Addison- Wesley, 2000.

A. O’Fallon, J. Hagemeister 22 Collaborators Jack Hagemeister