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

Similar documents
Introduction to Software Engineering. 5. Modeling Objects and Classes

Model Driven Development Unified Modeling Language (UML)

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

Unified Modeling Language

Ingegneria del Software Corso di Laurea in Informatica per il Management. Introduction to UML

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico

Object-Oriented Software Engineering Practical Software Development using UML and Java

Introduction to Software Engineering. 5. Modeling Objects and Classes

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

Engineering Design w/embedded Systems

UML (Unified Modeling Language)

Software Service Engineering

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

UML Diagrams & And Some Of Their Elements

Software Engineering

CHAPTER 1. Topic: UML Overview. CHAPTER 1: Topic 1. Topic: UML Overview

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

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 5: Modelling with Classes

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

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

Unified Modeling Language (UML) Class Diagram

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

OO Analysis and Design with UML 2 and UP

Object-Oriented Analysis and Design

Metamodeling with Metamodels. Using. UML/MOF including OCL

The Unified Modelling Language. Example Diagrams. Notation vs. Methodology. UML and Meta Modelling

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

Lecture #2 on Object-Oriented Modeling

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

LESSON PLAN SUB NAME : OBJECT ORIENTED ANALYSIS AND DESIGN UNIT SYLLABUS

JOURNAL OF OBJECT TECHNOLOGY Online at Published by ETH Zurich, Chair of Software Engineering. JOT, 2002

UML Primer. -Elango Sundaram

Modeling Requirements

Chapter 12. UML and Patterns. Copyright 2008 Pearson Addison-Wesley. All rights reserved

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

The Unified Modeling Language (UML)

Metamodeling. Janos Sztipanovits ISIS, Vanderbilt University

Modelling with Classes. CITS1220 Software Engineering

UML 2.0 State Machines

Index. Add Diagram > Sequence Diagram command,

1 Reference Material for these slides is taken from many UML reference books. However, the two I most often used are: UML Explained, by Kendall Scott,

CISC 322 Software Architecture

administrivia today UML start design patterns Tuesday, September 28, 2010

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

UNIT I. 3. Write a short notes on process view of 4+1 architecture. 4. Why is object-oriented approach superior to procedural approach?

Design and UML Class Diagrams

UML REFERENCE SHEETS. 2013, 2014 Michael Marking; all rights reserved, including moral rights. Web site:

Object-Oriented Design

Domain Engineering And Variability In The Reuse-Driven Software Engineering Business.

LABORATORY 1 REVISION

Object-Oriented Design

Course 3 7 March

Formal Specification of Software Systems

2 UML for OOAD. 2.1 What is UML? 2.2 Classes in UML 2.3 Relations in UML 2.4 Static and Dynamic Design with UML. UML for OOAD Stefan Kluth 1

Proposal of a Supporting Method for Diagrams Generation with the Transformation Rules in UML

EVALUATION COPY. The Unified Modeling Language. Unauthorized reproduction or distribution is prohibited. Student Workbook

Software Engineering Lab Manual

Object-Oriented Design

Automation of Semantic Web based Digital Library using Unified Modeling Language Minal Bhise 1 1

UML Modeling. Sumantra Sarkar. 29 th June CIS 8090 Managing Enterprise Architecture

1 Introduction. 1.1 Introduction

A UML 2 Profile for Variability Models and their Dependency to Business Processes

The Unified Modeling Language User Guide

Unified Modeling Language (UML)

Unified Modeling Language (UML)

02291: System Integration

Object-Oriented Software Development Goal and Scope

Software Development Methodologies

Génie Logiciel Avancé - Advanced Software Engineering A Brief Revision of UML

Object Oriented Modeling

Dr.S.S.Riaz Ahamed Principal, Sathak Institute of Technology, Ramanathapuram,India.

Index. : (colon), 80 <<>> (guillemets), 34, 56

Object-Oriented Systems Development: Using the Unified Modeling Language

Software Design And Modeling BE 2015 (w. e. f Academic Year )

Software Engineering from a

Object-Oriented Analysis and Design. Pre-UML Situation. The Unified Modeling Language. Unification Efforts

UML Start-Up Training UB1

Coral: A Metamodel Kernel for Transformation Engines

Index. business modeling syntax 181 business process modeling 57 business rule 40

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

Design Engineering. Dr. Marouane Kessentini Department of Computer Science

Object-Oriented Analysis and Design Using UML

BCS Higher Education Qualifications. Diploma in IT. Object Oriented Programming Syllabus

Object-Oriented Analysis Techniques Coad s OOA Technique Short History Terminological Comparison Postscript and Remarks

02291: System Integration

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

Research Review on Basic Principles of Unified Modelling Language

Requirements Analysis and Negotiation

Unified Modeling Language (UML)

CMSC 132: Object-Oriented Programming II

EECE 310: Software Engineering

Introduction for using UML

TTool Training. I. Introduction to UML

SE203b: OO Design for Software Engineers. Office: TEB349, Ext

A UML 2 Profile for Variability Models and their Dependency to Business Processes

Chapter 2, Modeling with UML, Part 2

MechEng SE3 Lecture 7 Domain Modelling

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

Exercise Unit 2: Modeling Paradigms - RT-UML. UML: The Unified Modeling Language. Statecharts. RT-UML in AnyLogic

Credit where Credit is Due. Lecture 4: Fundamentals of Object Technology. Goals for this Lecture. Real-World Objects

Transcription:

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

Object-Oriented Design: Topics & Skills Rational Unified Process Unified Modeling Languages (UML) Provide a range of notations that can be used to document an object-oriented design. Structure Behavior Requirements Use Case Diagrams Design Design Patterns Class Diagrams Package Diagrams Sequence Diagrams State Diagrams Activity Diagrams Reuse solutions, rather than solve every problem from first principles. 2

The History of UML Developed by the following three people at the Rational Software Corporation in 1996 (UML 0.x). Grady Booch (the Booch method) Ivar Jacobson (the OOSE method) James Rumbaugh (the OMT method) The Object Management Group (OMG) started the process of UML standardization in 1997 (UML 1.x). The current version is UML 2.4.x. 3

UML Diagrams 4

UML Metamodel Metamodel A model that is written in a language (called metalanguage) to define some specific modeling language. For example: UML is defined by its metamodel, which is written in MOF. Meta level Reflects the linguistic instance-of relationship between a model and its metamodel. In other words, a model is written in a language that is defined by the model s metamodel at a higher meta level. 5

UML Metamodel Layer Description Instance M3: metametamodel M2: metamodel M1: model Define the language for specifying metamodels. An instance of a metametamodel, defining the language for specifying models. An instance of a metamodel, modeling a specific information domain. M0: systems An instance of a model 6 Meta-Object Framework (MOF). UML, CWM, XMI. UML model, data model. Modeled systems

7 Overview of Layers M0 to M3. - [MDA Explained, Addison-Wesley, 2003]

UML Class Diagram Definition: a class diagram describes the types of objects in the system and the various kinds of static relationships that exist among them. Essential elements Classes Attributes Operations Associations Generalization Aggregation Composition 8

An Example of UML Class Diagram 9

Classes Identity Attributes Class attributes operations() visibility name: type multiplicity = default {propertystring} Operations visibility name (parameter-list) : return-type {property-string} parameter-list: direction name: type = default 10

Attribute Syntax visibility name: type multiplicity = default {property-string} optional visibility: + public, - private, # protected name: the name of this attribute optional type: data type of this attribute optional multiplicity: optional [0..1], mandatory [1]. optional default: initial value of attribute optional property string: OCL, e.g. ordered, readonly Examples firstname, -lastname: String -age: int {>=0} - name: String [1] = "Untitled" {readonly} 11

Property String Any information that cannot be expressed in the diagram notation can be included as text. Most of them are constraints. Can be Informal English Object Constraint Language The only rule Put them inside braces ({}) 12

Operation Syntax visibility name (parameter-list) : return-type {property-string} optional visibility: + public, - private, # protected name: the name of this operation optional parameters-list, parameters to this operation (separated by a comma): direction name: type = default optional direction: in, out, inout name optional type optional default optional type: return type of operation optional property string 13

Operation Syntax Examples getfirstname() {query} +getmiddlename(): String -setlastname(name: String) {sequential} +paintportrait(inout c: Canvas, subject: Person) 14

Associations Relationships between instances of classes E.g. a person works for a company; a company has a number of offices. Roles Name labeled on an association end. If no label, an association end can be named after the target class. Multiplicities Indicates how many objects may participate in the given relationship. 0, 1, *, 0..1, 1..*, 5..6, and so on. Would be realized through Arrays, Sets, Lists, and so on. Navigability Bidirectional: each class references the other. Unidirectional: A knows B, but B doesn t know A. No arrow heads: means either bidirectional or not specified. 15

Associations Associations are another way of representing attributes. 16

Question When to use attributes versus association lines? Data type refers to objects for which unique identity is not important. Common data types are primitive-oriented types, such as Boolean, Date, Number, Character, String, Time, Address, Color, Phone Number, Social Security Number, Zip code. Use the attribute for data type objects and the association line notation for others. Both are semantically equal, but showing an association line to another class box in the diagram gives visual emphasis. 17

Variations of Associations Generalization Inheritance relationship between instances of two classes. Correspond to the Java keyword "extends" (is-a). Aggregation Special associations that represent part-whole relationships (part-of) - parts can join the whole and later leave; one part could be part of more than one whole. Composition A strong kind of aggregation (has-a) - parts are created with the whole and stay with exactly one whole until both are destroyed together. 18

Generalization Generalization corresponds to "extends Generalizations are drawn with a solid line and a white triangular arrow touching the superclass. It is common practice to arrange the diagram so that: Generalization arrows point upward. If one class has many subclasses, the Generalization arrows overlap. 19

Aggregation Aggregations are special associations that represent part-whole relationships. The whole side is often called the assembly or the aggregate. This symbol is a shorthand notation association named ispartof. 20

Composition A composition is a strong kind of aggregation. If the aggregate is destroyed, then the parts are destroyed as well. 21

Some Mnemonics Generalization = is-a Aggregation = part-of Composition = has-a Examples Toaster is-a Appliance Member part-of club Toaster has-a slot 22

Advanced Concepts of Class Diagrams Stereotypes and profiles The core extension mechanism of the UML Stereotypes are usually shown in text between guillemots (<<>>) A profile is defined by a set of steotypes, a set of related constraints (in OCL), and a set of tagged valued. Object Diagram (Instance Diagram) A snapshot of the objects in a system at a point in time The names are underlined. Each name takes the form: instance name : class name. Interfaces and Abstract Classes 23

Example: Class to Object Diagrams 24

Interfaces and Abstract Classes Question: what is different between abstract classes and interfaces in an object-oriented programming language (e.g. Java)? 25

Interfaces and Abstract Classes UML Interface A class that has only public operations with no method bodies or attributes. Representation Italicize the name of interfaces or abstract classes. Use the {abstract} constraint for abstract classes (optional) and the <<interface>> stereotype for interfaces. Realization Relationship between an implementation class and an interface. Drawn with a dashed line and a white triangular arrow touching the interface. 26

Example 27

To summarize 28

Package Diagrams Package is a grouping construct. Most commonly used for class diagrams, but can be used with any UML diagram or elements. Used to create a hierarchy or higher level of abstraction. Corresponds to package in Java. Each package represents a namespace. Like Java, can have classes with same name in different packages. 29

Representing Packages 30

References Software Engineering van Vliet, Hans. Software Engineering: Principles and Practice. 2nd edition. Addison-Wesley, 2000. UML Modeling Craig Larman. Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development, 3rd Edition. Prentice Hall, 2005. ISBN-10: 0131489062. Fowler, M. 2003 UML Distilled: a Brief Guide to the Standard Object Modeling Language. 3. Addison-Wesley Longman Publishing Co., Inc. 31

Reminder Lab #2 is on next Tuesday. Assignment #2 will be out after the lab. Assignment #1 is due next Monday midnight. 32