Introduction to Unified Modelling Language (UML)

Similar documents
Object-Oriented Design

Architectural Blueprint

Unified Modeling Language

Introduction to Unified Modelling Language (UML)

Object-Oriented Design

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

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

OO Analysis and Design with UML 2 and UP

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

Object-Oriented Design. Module UFC016QM. and Programming. Objects and Classes. O-O Design Unit 2: Faculty of Computing, Engineering

Introduction to Software Engineering. 5. Modeling Objects and Classes

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

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

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

INTERNAL ASSESSMENT TEST III Answer Schema

An Introduction to Software Architecture By David Garlan & Mary Shaw 94

Experiment no 4 Study of Class Diagram in Rational Rose

For 100% Result Oriented IGNOU Coaching and Project Training Call CPD TM : ,

Objectives. Explain the purpose and objectives of objectoriented. Develop design class diagrams

Object-Oriented Design

Software Engineering from a

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

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

Outline of UML and Unified Process. Object Oriented Analysis/Design/Programming UML1.5. Koichiro Ochimizu, JAIST. UML&UP outline 1.

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

Chapter No. 2 Class modeling CO:-Sketch Class,object models using fundamental relationships Contents 2.1 Object and Class Concepts (12M) Objects,

MechEng SE3 Lecture 7 Domain Modelling

Introduction to Computers and Programming Languages. CS 180 Sunil Prabhakar Department of Computer Science Purdue University

Object-Oriented Design

UNIT 5 - UML STATE DIAGRAMS AND MODELING

Unified Modeling Language (UML) Class Diagram

Topic : Object Oriented Design Principles

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

In this Lecture you will Learn: Object Design. Information Sources for Object Design. Class Specification: Attributes

Class Diagram. Classes consist of. Note that class diagrams contain only classes, not objects.

Object-Oriented Analysis, Design and Implementation. Case Study Part II

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

Class Diagram. Classes consist of. Note that class diagrams contain only classes, not objects.

22/09/2012 INFO2110. Copyright Warning. Revision of class diagram. Overview. Purpose of class diagram. Generalization Relationship

UML: Unified Modeling Language

12 Tutorial on UML. TIMe TIMe Electronic Textbook

Software Design and Analysis CSCI 2040

Static Modeling. SWE 321 Fall2014

Lab Manual. Object Oriented Analysis And Design. TE(Computer) VI semester

An Introduction to Software Architecture By David Garlan & Mary Shaw 94

Object Oriented Modeling

Introduction to UML What is UML? Motivations for UML Types of UML diagrams UML syntax Descriptions of the various diagram types Rational Rose (IBM.. M

CPS122 Lecture: Defining a Class

Object-Oriented Systems Analysis and Design Using UML

10조 이호진 이지 호

Hippo Software BPMN and UML Training

2.0.3 attributes: A named property of a class that describes the range of values that the class or its instances (i.e., objects) may hold.

Introduction to Computers and Programming Languages. CS 180 Sunil Prabhakar Department of Computer Science Purdue University

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

Architecture and the UML

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

University of Calgary Department of Electrical and Computer Engineering. SENG : Object Oriented Analysis and Design Behrouz Homayoun Far

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

Class diagrams and architectural design

Design Engineering. Dr. Marouane Kessentini Department of Computer Science

CS487 Midterm Exam Summer 2005

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

CS112 Lecture: Defining Classes. 1. To describe the process of defining an instantiable class

Software Specification 2IX20

Chapter 10 Object-Oriented Design Principles

UML Diagrams & And Some Of Their Elements

Engineering Design w/embedded Systems

Chapter 2: The Object-Oriented Design Process

Accessibility. EEC 521: Software Engineering. Classes and Objects. Inheritance. Classes and Objects (OO Analysis)

Computer Programming II C++ (830)

SEEM4570 System Design and Implementation. Lecture 11 From Design to Implementation

Introducing the UML Eng. Mohammed T. Abo Alroos

Darshan Institute of Engineering & Technology for Diploma Studies

CS112 Lecture: Defining Instantiable Classes

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

Introduction to Software Engineering. 5. Modeling Objects and Classes

2.0.3 attributes: A named property of a class that describes the range of values that the class or its instances (i.e., objects) may hold.

Prepared By:Mitali sonar

SDC Design patterns GoF

IMPORTANT NOTICE TO STUDENTS

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

Computer Programming II Python

Model Driven Development Unified Modeling Language (UML)

CSCU9T4: Managing Information

Designing Component-Based Architectures with Rational Rose RealTime

Design Patterns. Dr. Rania Khairy. Software Engineering and Development Tool

Outline of Unified Process

OO System Models Static Views

Model-based Transition from Requirements to High-level Software Design

In this Lecture you will Learn: Design Patterns. Patterns vs. Frameworks. Patterns vs. Frameworks

1st Semester MTCE 601A COMPUTER SYSTEM SOFTWARE

UML Views of a System

Notation Part 1. Object Orientated Analysis and Design. Benjamin Kenwright

SE 1: Software Requirements Specification and Analysis

(C) 2010 Pearson Education, Inc. All rights reserved. Dr. Marenglen Biba

2.0.3 attributes: A named property of a class that describes the range of values that the class or its instances (i.e., objects) may hold.

Component Design. Systems Engineering BSc Course. Budapest University of Technology and Economics Department of Measurement and Information Systems

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

Object-oriented basics. Object Class vs object Inheritance Overloading Interface

UML Is Not a Methodology

Transcription:

IMPORTANT NOTICE TO STUDENTS These slides are NOT to be used as a replacement for student notes. These slides are sometimes vague and incomplete on purpose to spark a class discussion Introduction to Unified Modelling Language (UML) (part 2 Class diagram, Associations) CS 446/646 ECE452 May 6 th, 2011 Material covered in this lecture is based on various chapters from UML 2 and the Unified Process 2 nd Edition Practical Object Oriented Analysis & Design

Objects What are Objects a discrete entity with a well-defined boundary that encapsulates state and behaviour; an instance of a class UML Reference Manual, 2 nd Edition-2004 Observations an instance of a class state is maintained in fields behaviour is implemented via methods every object is uniquely identified 2

UML Object Notation Representation box with two compartments object identifier always underlined anonymous objects : instanceof attribute compartment object:class accountnumber : String = 123 owner : String = Jim Andrew balance : double = 300.00 :class accountnumber : String = 123 owner : String = Jim Andrew balance : double = 300.00 may omit some or all fields 3

What are Classes Classes the descriptor for a set of objects that share the same attributes, operations, methods, relationships, and behaviour UML Reference Manual, 2 nd Edition-2004 template for objects with similar features 4

UML Class Notation class name stereotype tagged value name compartment attribute compartment operation compartment visibility -accountnumber : String -owner : String -balance : double «entity» BankAccount +create (number : String, owner : String) +deposit (amount : double) +getaccountnumber():string +getowner():string {author = Jim, status = tested } class scope operation 5

UML Class Notation «exercise» StudentToDo + reviewandlearnmissingumlclassnotations() 6

Scenarios How Much to Show? scenario 1: inter-class relationship scenario 2: behaviour of a class or classes scenario 3: entity classes representing data entities 7

Scenarios How Much to Show? scenario 1: inter-class relationship class boxes are probably enough with name compartment only scenario 2: behaviour of a class or classes class boxes with name & operations compartment scenario 3: entity classes representing data entities ask the class? 8

Analysis Classes What is an Analysis Class? represents an important concept of the problem domain maps on to real-world concepts an attempt to capture the big picture BankAccount accountnumber owner balance deposit () getaccountnumber() getowner() Q: what about savings account sub-class of BankAccount? SavingAccount 9

Analysis Classes Important Analysis Classes «boundary» a class that mediates interaction between the system (or subsystem) and its environment «control» a class that encapsulates use case specific behaviour «entity» a class that is used to model persistence information 10

Observations Analysis Classes name reflects the intent of abstraction focus clearly defined/understood small & well defined set of responsibilities high cohesion & low coupling BankAccount Q: responsibility, cohesion & coupling? Q: can we use analysis classes for implementation? accountnumber owner balance deposit () withdraw() calculateinterest() clientpromotion() 11

What is a Design Class? Design Classes Integrates the problem domain & solution domain problem domain refined analysis classes solution domain implementation specific classes are complete, ready to be implemented BankAccount -accountnumber : String -owner : String -balance : double = 0 +BankAccount (owner:string, number:string) +deposit (m:double):void +withdraw (m:double):void - validatewithdraw():boolean 3 +getowner():string 1 2 12

Design Classes Concerns responsibility the public methods imply a contract code evolution should be considered inheritance major concern of design classes (why?) 13

Concerns Inheritance Under Review the strongest form of coupling between classes fragile base class problem changes in the base class impact subclasses inflexible to change fixed at runtime 14

Example: Ambitious John How to promote john to be a manager? john:programmer vs. john:manager 15

Example: Ambitious John Aggregation to rescue employee has a job 16

Inheritance Inheritance or Interface interface & implementation concerns with reuse Interface interface only concerns with functionality contract design by contract concerns with reuse (what?) 17

Further Considerations Student Self-Study Templates Nested classes Multiple Inheritance 18

Association Relationship What is an Association? connection between two things (usually classes) for a link between two object, there must be an association between the class of those objects link is an instance of an association link can be represented by dependency relationship Group association User «instanceof» «instanceof» «instanceof» admin:group link john:user 19

Decipher this a Company can have exactly seven employees a Person can be employed by exactly one Company Example a BankAccount can have exactly one owner a Person may have zero to many BankAccounts a BankAccount can have one or many operators a Person may operate zero to many BankAccounts 20

Definition Reflexive Association A class has an association with itself 21

Class Diagram Reflexive Association Object Diagram 22

Review the following Navigation navigation notation & rules uni-direction & bi-direction associations 23

Composition Types of Association strong whole/part (owner/slave) relationship between classes can we have more than 1 parent? what happens when the parent is destroyed? 24

Aggregation Types of Association weaker whole/part relationship between classes classes can exist on their own observations a computer may be attached to zero or more printers many computers can use a printer printer may exist even if there are no computers aggregation is transitive 25

Analysis classes Association Classes Design classes 26

Observations Association Classes association classes are purely analysis classes convert association class into normal design class use the various relationships to clarify association (aggregation, composition, dependency) additional constraints to refine the model navigation, multiplicity 27

Compulsory Reading Sequence diagram State diagram Activity diagram Student Study 28