CS 247: Software Engineering Principles. UML Modelling

Similar documents
Software Modelling. UML Class Diagram Notation. Unified Modeling Language (UML) UML Modelling. CS 247: Software Engineering Principles

Engineering Design w/embedded Systems

Introduction to OO Concepts

Principles of Software Construction: Objects, Design and Concurrency. Just enough UML. toad

Software Service Engineering

Introduction to Software Engineering. 5. Modeling Objects and Classes

Software Specification 2IX20

CSE 403: Software Engineering, Spring courses.cs.washington.edu/courses/cse403/15sp/ UML Class Diagrams. Emina Torlak

UML Modeling I. Instructor: Yongjie Zheng September 3, CS 490MT/5555 Software Methods and Tools

Today s Topic. Lecture 5. What is UML? Why Use UML. UML Diagrams. Introduction to UML. What is UML Why use UML? UML Diagrams

Lecture 33 April 4, Unied Modelling Language. ECE155: Engineering Design with Embedded Systems Winter Patrick Lam version 1

EE 446 EMBEDDED ARCHITECTURE Embedded System in UML (2)

Today's Agenda. References. Open Closed Principle. CS 247: Software Engineering Principles. Object-Oriented Design Principles

Details of Class Definition

S T R U C T U R A L M O D E L I N G ( M O D E L I N G A S Y S T E M ' S L O G I C A L S T R U C T U R E U S I N G C L A S S E S A N D C L A S S D I A

Programming II (CS300)

Object-Oriented and Classical Software Engineering

Introduction to UML Diagrams

Class Diagrams in Analysis

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1,2 and 3, Spring 2017

to schedule pressure

Design and UML Class Diagrams

CS 405G: Introduction to Database Systems

LABORATORY 1 REVISION

Object-Oriented Systems Analysis and Design Using UML

Classes. Classes as Code Libraries. Classes as Data Structures

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg

MSc programme (induction week) Department of Informatics INTRODUCTION TO UML

UML Is Not a Methodology

Structural specification

COMP 354: INTRODUCTION TO SOFTWARE ENGINEERING

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models

Unified Modeling Language (UML)

CS246 Software Abstraction and Specification Final Examination

Learning objectives. Unified Modeling Language (UML) crash course. Note well. Intro. Understand the concepts of UML model and UML diagram

2D1358 Object Oriented Program Construction in C++ Exercises & Labs. Course Registration / Accounts. Course Literature

The Unified Modeling Language (UML)

Modeling XML Vocabularies with UML: Part I

The Unified Modeling Language. Asst.Prof.Dr. Supakit Nootyaskool IT-KMITL

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

Modeling with UML. (1) Use Case Diagram. (2) Class Diagram. (3) Interaction Diagram. (4) State Diagram

LECTURE 3: ENTITY-RELATIONSHIP MODELING

UML Diagrams & And Some Of Their Elements

Practical UML - A Hands-On Introduction for Developers

ACS-3913 Ron McFadyen 1. UML Notation for Class diagrams Object diagrams

San Jose State University - Department of Computer Science

Course Content. Objectives of Lecture 24 Inheritance. Outline of Lecture 24. Inheritance Hierarchy. The Idea Behind Inheritance

Computer Science for Engineers

Copyright 2016 Ramez Elmasr and Shamkant B. Navathei

Course Content. Objectives of Lecture 24 Inheritance. Outline of Lecture 24. CMPUT 102: Inheritance Dr. Osmar R. Zaïane. University of Alberta 4

Object-Oriented Design

Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts

Data Modeling Using the Entity-Relationship (ER) Model

Intro to Modelling and UML

Overview of Database Design Process. Data Modeling Using the Entity- Relationship (ER) Model. Two main activities:

CS/IT Secure Software Construction

Unit1: Introduction. Database System Concepts, 6 th Ed. Silberschatz, Korth and Sudarshan See for conditions on re-use

SE 1: Software Requirements Specification and Analysis

EECE 310: Software Engineering

UML data models from an ORM perspective: Part 4

Lecture 09. Spring 2018 Borough of Manhattan Community College

CSCU9T4: Managing Information

Today s Agenda UML. CompSci 280 S Introduction to Software Development. 1.Introduction UML Diagrams. Topics: Reading:

L12: ER modeling 5. CS3200 Database design (sp18 s2) 2/22/2018

Suggested answers are provided below. These answers are presented top-down, left to right.

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

UML Primer. -Elango Sundaram

Practical UML : A Hands-On Introduction for Developers

CS111: PROGRAMMING LANGUAGE II. Lecture 1: Introduction to classes

CSC207 Week 2. Larry Zhang

CLASS DISCUSSION AND NOTES

COSC 3351 Software Design. An Introduction to UML (I)

CS 370 REVIEW: UML Diagrams D R. M I C H A E L J. R E A L E F A L L

Programming II (CS300)

UML & OO Fundamentals. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 3 09/04/2012

From Analysis to Design. LTOOD/OOAD Verified Software Systems

Chapter 2: Relationship between. classes using UML. Dr. Safwan Qasem

Classes. Classes as Code Libraries. Classes as Data Structures. Classes/Objects/Interfaces (Savitch, Various Chapters)

UML & OO FUNDAMENTALS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 3 08/30/2011

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

Week 4 Tute/Lab Entity-Relationship (ER) Model

Lesson 11. W.C.Udwela Department of Mathematics & Computer Science

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

Design Patterns (Facade, Composite)

Software Development Methodologies

Requirement Analysis & Conceptual Database Design

02291: System Integration

Course 3 7 March

More on the Chen Notation

SEEM4570 System Design and Implementation Lecture 11 UML

02291: System Integration

Data Modeling and the Entity-Relationship Model

UML Fundamental. OutLine. NetFusion Tech. Co., Ltd. Jack Lee. Use-case diagram Class diagram Sequence diagram

SWEN-220 Mathematical Models of Software. Conceptual to Relational Mapping

Introduction to Software Engineering. 5. Modeling Objects and Classes

Chapter 8 The Enhanced Entity- Relationship (EER) Model

Course "UML and Design Patterns" of module "Software Engineering and Design", version February 2011 (X)

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page:

What are the characteristics of Object Oriented programming language?

Transcription:

CS 247: Software Engineering Principles UML Modelling Agenda: UML class diagrams UML object diagrams UML sequence diagrams Reading: Martin Fowler, UML Distilled, 3rd ed, Addison-Wesley Professional, 2004. (Electronic text available from UW Library Web site) www.uml.org U Waterloo CS247 (Spring 2017) p.1/18

Software Modelling Publication[p] borrow(m,p) / BorrowItem(m, p, today) InStacks OnLoan return(p) / ReturnItem(p, today) lost A software model is an abstraction of a software system's code (already developed or to-be-developed). Analogous to construction plans U Waterloo CS247 (Spring 2017) p.2/18

Unified Modeling Language (UML) UML - A collection of notations for representing different views of a software design. Structural Diagrams Class diagram Component diagram Composite structure diagram Deployment diagram Object diagram Package diagram Behaviour Diagrams Activity diagram State diagram Use case diagram Interaction Diagrams Communication diagram Interaction overview diagram Sequence diagram Timing diagram U Waterloo CS247 (Spring 2017) p.3/18

UML Class Diagram Notation A box represents a class and defines: class name set of attributes (data fields, types), initial values set of operations (routines, signatures) Customer name: string address: string Customer( name ) name() : string address() : string addressis( newaddr : string ) : void U Waterloo CS247 (Spring 2017) p.4/18

Abstraction in Classes Classes can be expressed at different levels of abstraction. Customer Customer name address birthdate Customer name: string [1] {readonly} address: string + Customer( name:string ); + name() : string {query} + address() : string {query} + addressis( newaddr : string ) : void KEY: + public private # protected static pure virtual U Waterloo CS247 (Spring 2017) p.5/18

Associations An association between two classes indicates that there exists a physical or conceptual link between objects of those classes. Date day month year start date end date Rental Agreement rents driver customer Person firstname : string lastname : string Association name Vehicle manuf model color VIN rented car Role names U Waterloo CS247 (Spring 2017) p.6/18

Multiplicities Multiplicity annotations constrain the number of allowable links in an association. 0 m n 0 p X m..n R p..* Y For each object x of class X, there must be at least p links of association R linking x to object of class Y; and For each object y of class Y, there must be between m and n links of association R linking y to object of class X. No annotation means that the multiplicity is unspecified. U Waterloo CS247 (Spring 2017) p.7/18

Implementing Associations A B A B A B A B 1 0..1 A B 1 5 * * U Waterloo CS247 (Spring 2017) p.8/18

Association Class A class association represents link attributes - properties of the link, because they cannot be attributed to either of the end objects Person contestant * * Race Performance time : Time place : int this is an association class, models data and relationships that are associated with a pair of objects U Waterloo CS247 (Spring 2017) p.9/18

Aggregation 0..1 ProjectTeam * subteam * 1..* Developer Aggregation is a part-of relation between an aggregate (collection) and its members. part can be a member of more than one aggregate e.g., students can be members of more than one class roster part has an identity outside of the aggregate U Waterloo CS247 (Spring 2017) p.10/18

Composition PurchaseOrder total : Money delivered : boolean * 1..* purchased Product type : string colour : Colour 1 catalogued Catalog year : Date version : integer 1 * 1 CatalogEntry number : string Composition is a stronger part of relation between a composite object and its components: a part does not exist without its composite a part belongs to at most one composite the composite is responsible for creating, destroying members U Waterloo CS247 (Spring 2017) p.11/18

Another Example On an ipod, songs (and other media) are physically stored in a Library, and Playlists are virtual collections of songs. Library 1 * Song * {ordered} * Playlist U Waterloo CS247 (Spring 2017) p.12/18

Generalization The UML uses the term generalization for the subtype relationship between a base class and its derived classes. Every member of a derived class is a member of its base class. Attributes and associations of the base class are attributes and associations of the derived class. Transcript - GPA : float + calcgpa() 1 1 Student - name : string - ID : int Math Transcript + calcgpa() Engineering Transcript + calcgpa() U Waterloo CS247 (Spring 2017) p.13/18

World Cup The first round, or group stage, is a round-robin competition between thirty-two teams divided into eight groups. The two best teams of each group will progress to the knockout stage. The ranking of teams in each group will be based on: 1. Points in all group matches 2. Goal difference in all group matches 3. Goals scored in all group matches 4. Points in matches between tied teams 5. Goal difference in matches between tied teams 6. Goals scored in matches between tied teams 7. Drawing of lots In the knockout stage there will be four rounds, each eliminating the losers. The four rounds are: the round of 16, quarter-finals, semi-finals, and the final (plus a play-off for third place). A draw in the knockout stages will be followed by two 15-minute periods of extra time to determine a winner. If the teams are still tied, a penalty shootout will be held. Wikipedia U Waterloo CS247 (Spring 2017) p.14/18

UML Object Models An object model is a run-time instance of a class model. Every object is an instantiation of a specific class. Every link is an instantiation of a specific association. (Optional) object name class name object and class names are underlined attribute names (Optional)attribute values s1:student firstname = "John" lastname = "Rincewind" s2:student firstname = "Stuart" lastname = "McLean" takes takes c1:course prefix = "CS" number = 247 section = 001 term = Spring year = 2017 :Student firstname = "Abby" lastname = "Goodrum" takes :Course prefix = SE number = 464 section = 001 term = Spring year = 2017 U Waterloo CS247 (Spring 2017) p.15/18

UML Sequence Diagram Notation A UML Sequence Diagram is a graphical model of communication events between objects, as exhibited in one execution trace. event, method call entities, objects, systems, subsystems, actors Time :PurchaseOrder :Product :Product :Product printreceipt() print() print() print() return message lifeline of object execution occurrence U Waterloo CS247 (Spring 2017) p.16/18

Some UML Drawing Tools Can use any UML modelling or drawing tool that you would like. - Must be able to output PDF files. Visio OmniGraffle (Mac only) UMLet (open source, Windows / OS X / Linux) http://www.umlet.com/ U Waterloo CS247 (Spring 2017) p.17/18

Take Aways Recognition Recognize class diagrams: class, attribute, association, association name, rolename, association class. Recognize rules for designating data as objects or attributes. Comprehension Distinguish between aggregation and composition. Understand program behaviour described as a sequence diagram. Application Model a program's set of classes as a class diagram. Use multiplicities to constrain allowable instances of a class diagram. U Waterloo CS247 (Spring 2017) p.18/18