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

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

Introduction to Software Engineering. 5. Modeling Objects and Classes

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

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

OO Techniques & UML Class Diagrams

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

Class modelling (part 2)

CHAPTER 5 CO:-Sketch component diagram using basic notations 5.1 Component Diagram (4M) Sample Component Diagram 5.2 Deployment Diagram (8M)

Chapter 5: Structural Modeling

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

Unified Modeling Language (UML) Class Diagram

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

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

Model Driven Development Unified Modeling Language (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

Class modelling (part 2)

Chapter 2: The Object-Oriented Design Process

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

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

Object-Oriented and Classical Software Engineering

Introduction to Software Engineering. 5. Modeling Objects and Classes

Object-Oriented Design

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

Unified Modeling Language

OO System Models Static Views

Introducing the UML Eng. Mohammed T. Abo Alroos

Vidyalankar. T.Y. Diploma : Sem. VI [IF/CM] Object Oriented Modeling and Design Prelim Question Paper Solution

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

Object-Oriented Systems Analysis and Design Using UML

Object Oriented Design. Program Design. Analysis Phase. Part 2. Analysis Design Implementation. Functional Specification

UML. By Somenath Mukhopadhyay.

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

Introduction to UML and Class Diagrams

Introduction to UML and Class Diagrams

MSO Analysis & UML. Hans Philippi (based on the course slides of Wouter Swierstra) August 24, Analysis & UML 1 / 56

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

Software Engineering I (02161)

Experiment no 4 Study of Class Diagram in Rational Rose

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

06. Analysis Modeling

Object-Oriented Design

Unified Modeling Language (UML)

UNIT 5 - UML STATE DIAGRAMS AND MODELING

Practical UML - A Hands-On Introduction for Developers

Class Diagram Example Document's body has sentences. Sentences are made up of words and punctual signs. Words consists of letters, numbers and/or spec

OO Analysis and Design with UML 2 and UP

Use of UML in Tranmodel

UML class diagrams. Nigel Goddard. School of Informatics University of Edinburgh

Pertemuan 8. Object Oriented Modeling and Design

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

+ Public - Private # Protected # Protected (Overridable) Static

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

Basic Structural Modeling. Copyright Joey Paquet,

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

Inheritance and Polymorphism

OOAD - OBJECT MODEL. The concepts of objects and classes are intrinsically linked with each other and form the foundation of object oriented paradigm.

Introduction to UML Dr. Rajivkumar S. Mente

1 Overview. 1 Overview. Contents. 1.1 Table of Contents Table of Contents

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

Introduction to Unified Modelling Language (UML)

Chapter 6: Entity-Relationship Model

CMPT 354 Database Systems I

12 Tutorial on UML. TIMe TIMe Electronic Textbook

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

Unified Modeling Language

Chapter 10 Object-Oriented Design Principles

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

Chapter 2: Entity-Relationship Model

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

Question Sheet There are a number of criticisms to UML. List a number of these criticisms.

Metamodeling with Metamodels. Using. UML/MOF including OCL

IS 0020 Program Design and Software Tools

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

Object Fundamentals Part Two. Kenneth M. Anderson University of Colorado, Boulder CSCI 4448/5448 Lecture 3 09/01/2009

UML Diagrams & And Some Of Their Elements

UML Tutorial. Unified Modeling Language UML Tutorial

A Conceptual Model of the UML

Class diagrams and architectural design

CSCI 253. Outline. Rationale. George Blankenship 1. Object Oriented Design: UML. George Blankenship

UML Class Diagrams Revisited

Clarifying Roles. Jonathan Worthington German Perl Workshop 2007

UNIT II. Syllabus. a. An Overview of the UML: Visualizing, Specifying, Constructing, Documenting

Chapter 7: Entity-Relationship Model

CS/IT Secure Software Construction

Practical UML : A Hands-On Introduction for Developers

The Essence of Object Oriented Programming with Java and UML. Chapter 2. The Essence of Objects. What Is an Object-Oriented System?

1/17/2014. UML Help and Details (from: UML for cse UML for a class. UML and project clarifications

Design and UML Class Diagrams

1. Introduction to Object Oriented Software Development

Polymorphism. Arizona State University 1

UML: Unified Modeling Language

Lecture 17: (Architecture V)

Äriprotsesside modelleerimine ja automatiseerimine Loeng 7 Valdkonna mudel

UNIT-II Introduction to UML

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

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

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

MSO Lecture 3. Wouter Swierstra. September 14, 2015

Relationships. Association Aggregation/Composition Multiplicity Dependencies

SE 1: Software Requirements Specification and Analysis

Transcription:

Class Diagrams UML

Class Diagram Classes consist of the class name written in BOLD features attributes and methods user defined constraints Note that class diagrams contain only classes, not objects.

Class Example Here is a concrete example of a class called Point, which depicts a 2D point. There are no constraints (yet...) A class name is written in UpperCamelCase

Visibility A set of prefixes for attributes and methods + public visible to instance of any class # protected visible to instances of any subclass private visible only to instances of the class itself ~ package visible to instance of any class within enclosing package Visibility is a class feature. It is found only in class diagrams and is enforced statically (at compile time).

Visibility

Inheritance In UML, inheritance syntax: a line with a hollow arrow. In this case, Cube is a Rectangle (good design).

Interfaces In UML, interfaces are used to represent require/provide relationships

Interfaces allow specification of Interfaces a realization of requires/provide relation. Interfaces describe a contract between the class and the outside world. This contract is enforced at build time by the compiler. all methods defined by that interface must be implemented by the class. UML: <<interface>> stereotype Note: stereotype and profile are UML's extension mechanisms

Abstract Members Abstract methods (in italic): no implementation given can not instantiate Class with at least one abstract method: Abstract Class. Inherit from Abstract Class and implement the abstract methods.

Templates As we saw with genericity, Templates are a mechanism to parametrize the types of objects in class/method definitions. In UML, they are defined with a box in the upper right corner of the class.

A package allows grouping model elements. Package Can be used for all UML constructs. Most common for Class Diagrams and Use Case Diagrams. Classes and objects in package have a prefix: ClassName::PackageName objectname:classname::packagename A package may (hierarchically) contain other packages.

Components

Class Attributes Class Attibutes aka static members (either attributes or methods) exist at the class level. Only one unique value across all instances of the class. They can be used without instantiating an object. UML syntax: underlined (why?).

Arrows Arrows in UML can have different meaning. Hollow arrows describe an inheritance relation. Closed arrows are used to describe associations. Diamond arrows define composition relations.

Annotations annotations put over arrows in class diagrams to specialize their meaning.

Special Inheritance Relations We can use stereotype relations to better define the type of inheritance. The three attributes are Disjoint or Overlapping Complete or Non complete Dynamic or Static These attributes are best understood using set theory. Dog Cat Animal

Animal Example

Vehicle Example

Employee Example

Implementation Employees can get promotion and become managers. Employees can get demoted and become nonmanagers. How would you implement this change?

Non-Manager to Manager How do we implement the dynamic change of a Non Manager becoming a Manager? Option A: Create new object Manager. Copy fields. Destroy old object Non Manager. Option B: Flag if Manager or not. So we only need an object employee and it contains all the attributes for Non Manager and Manager.

Association Associations describe which/how classes interact which each other. You can give an association a name (always a noun) A full black arrow next to a name indicates the direction the diagram can be read. You can put roles at the end of connectors. You can also put numbers to indicate cardinality.

Cardinality of Associations One to one Many to one or One to many Many to many

Employee Example

Association Class Used to represent associations which contain information.

Navigation Person object has a reference to dog object(s). Dog object has a reference to person object. Both objects have references to each other. This relates to performance (at the cost of space).

Association, in whole or in part Two special types of associations exists: Composition Aggregation

Which is which? Scenario 1 You can find books in a bookcase. Scenario 2 You can find shelves in a bookcase.

A composite object does not exist without its components. Composition If we delete a composite object, we could use cascading delete to remove it and its components. Often, components are of different types Each component is a part of a single composite.

Aggregation Aggregate (whole) object can exist without aggregands (parts). Objects may be part of multiple aggregates. Often, components are of the same type.