Class Diagram.

Slides:



Advertisements
Similar presentations
Object-oriented modeling Class/Object Diagrams
Advertisements

Stereotypes Stereotypes provide the capability to create a new kind of modeling element. –They can be used to classify or mark modeling elements. –A type.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
Chapter 14 (Web): Object-Oriented Data Modeling
UML Class Diagram and Packages
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Class Diagram & Object Diagram
7M822 UML Class Diagrams advanced concepts 15 September 2008.
7M822 UML Class Diagrams advanced concepts 14 October 2010.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
Chapter 14: Object-Oriented Data Modeling
Object-Oriented Analysis and Design
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 4th Edition Copyright © 2012 John Wiley & Sons, Inc. All rights.
Object-Oriented Modeling Chapter 10 CSCI CSCI 1302 – Object-Oriented Modeling2 Outline The Software Development Process Discovering Relationships.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
CHAPTER 13 (ONLINE): OBJECT-ORIENTED DATA MODELING © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
1 © Prentice Hall, 2002 Chapter 14: Object-Oriented Data Modeling Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R.
© 2011 Pearson Education 1 Chapter 13 (Online): Object-Oriented Databases Modern Database Management 10 th Edition, International Edition Jeffrey A. Hoffer,
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 02. Objects,
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
بسم الله الرحمن الرحيم ” اللهم أنت ربي لا إله إلا أنت خلقتني و أنا عبدك وأنا على عهدك ووعدك ما استطعت ، أعوذ بك من شر ما صنعت ، أبوء لك بنعمتك على و أبوء.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 03. Classes,
1 Class Diagrams: Advanced Concepts. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are the most commonly used diagrams.
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
Class diagram Used for describing structure and behaviour in the use cases Provide a conceptual model of the system in terms of entities and their relationships.
Database Development Supertype, Subtype, and Business Rules Powered by DeSiaMore 1.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
UML Class Diagrams 1 These lecture slides are copyright (C) Marty Stepp, They may not be rehosted, sold, or modified without expressed permission.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Lecture 1: UML Class Diagram September 12, UML Class Diagrams2 What is a Class Diagram? A class diagram describes the types of objects in the system.
Class Diagram. Classes Software Design (UML) Class Name attributes operations A class is a description of a set of objects that share the same attributes,
Week III  Recap from Last Week Review Classes Review Domain Model for EU-Bid & EU-Lease Aggregation Example (Reservation) Attribute Properties.
Object-Oriented Data Modeling
Design Model Lecture p6 T120B pavasario sem.
Chapter 4 Introduction to Classes, Objects, Methods and strings
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Object Oriented Analysis and Design Class and Object Diagrams.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Class Diagram Chapter 21 Applying UML and Patterns Craig Larman.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Object-Oriented Design.
Class diagrams Terézia Mézešová.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
Object Modeling THETOPPERSWAY.COM. Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
Class Diagram Lecture # 1. Class diagram A Class Diagram is a diagram describing the structure of a system shows the system's classes Attributes operations.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
Chapter 5: Structural Modeling
 Class and Diagram  Representation of Class Name Attributes Operations  Visibility of Attributes and Operations.
UNIT-IV Designing Classes – Access Layer ‐ Object Storage ‐ Object Interoperability.
Unified Modeling Language (UML)
UML-Class Diagrams. UML-Class Diagrams Order placement problem A Company has two types of customers, corporate customers and personal customers. All.
Visit for more Learning Resources
Chapter 5: Structural Modeling
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Introduction to UML Introduction to UML Shiyuan Jin September,23,2002
Object Oriented Analysis and Design
UML Class Diagram.
Unified Modelling Language
Class Diagrams Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application.
Object Oriented System Design Class Diagrams
Presentation transcript:

Class Diagram

Class Diagram A class diagram shows the existence of classes and their relationships in the logical view of the system. Graphical presentation of the static view.

Classes A class is represented as a three-part box Class Name Attributes At conceptual level it is a piece of information associated with the class that can be accessed and possibly modified Corresponds to a field at the implementation level

Operations The processes the class can carry out (methods at implementation level) - Basic operations (such as getValue) on attributes can be omitted (they can be inferred)

Classes Attribute syntax: visibility name: type = defaultValue Operation syntax: visibility name(parameter-list): return-type Customer Class Name Name address Attributes +creditRating():String Operations

Path name (Package-name :: Class-name) Visibility: - public + - protected # - private – Class Names: Simple Path name (Package-name :: Class-name) Window Banking :: CheckingAccount For abstract classes, class name is written in italic: Customer

Abstract Class Abstract Operation

Class Diagram - Relationship Association: bi-directional semantic relationship Aggregate: a whole and part relationship Generalization: inheritance relationship Dependency: single-directional relationship between a client class and a supplier class/interface Realize: single-directional relationship. A class realizes the operations offered by the interface.

Structural Modeling: Core Relationships

Structural Modeling: Core Relationships (cont’d)

Associations Associations are shown as lines between classes An association shows a relationship between instances of two classes Each association has two roles (one for each direction) A role can be explicitly named with a label Roles have multiplicity showing how many objects participate in the relationship

Associations can have multiplicities: A fixed value (such as 1 or 3) Many denoted by * (unlimited number) A range of values 0..1 or 3..* A set of values 2,4,8

Adds attributes and operations to an association Association Class Adds attributes and operations to an association Allows exactly one instance of the association class between any two objects Can use an actual class instead, if you need more 0..4 10..20 Student Course Grade

0..* 1..* Company Person employer employee Job description dateHired salary

Qualified Association Association can be keyed by the value of the qualifier. A qualifier is used to reduce the scope of an association. A qualifier in an association solves the lookup problem. qualifier 1 * finds Reservation Clerk Confirmation Number

Constraints Represent further restrictions on associations or classes A constraint is shown as a text string enclosed in braces { }. A constraint is a restriction on one or more values of (part of) an object-oriented model or system. {ordered } Serves Bank Teller Customer Chooses Academic High School Student { or } Chooses Commercial

1 1 1 1 * * * 1 Meal - - - - - - - - { or } - - - - - - - - - - - - - - { precedes } - - - - 1 1 1 1 Soup Salad Main Course Dessert * Member-of * Committee Person { subset } Chair-of * 1

ATM_Withdrawl Account customer : id amount : Money {amount is multiple of $20} Account balance : Money

Aggregation and Composition Aggregation is a part-of relationship. Composition is also a part-of relationship, but part and whole live and die together In aggregation, parts may be added or removed, they may survive even after the whole is dead while in composition parts are contained in the whole and die with the container. Aggregation is more loosely coupled than composition.

1 1 2 1 1 Computer shows aggregation Speaker CPU Keyboard Monitor Mouse

Table shows composition 1 4 Leg Table Top

Generalization Sharing mechanism based on Customer Sharing mechanism based on a hierarchical relationship between classes. Subtype is a specialization of the supertype. Is-kind-of Relationship name address creditRating():String indicates generalization Corporate Customer Personal Customer creditCardNumber contactName creditRating creditLimit remind() billForMonth(Int)

Generalization Relationship vehicle land vehicle water vehicle car amphibian vehicle ship

Dependency Relationship

Realization Relationship Realization is the relationship between a class and an interface. The class is said to realize the operations in the interface.