CLASS DIAGRAMS A classy approach to objects. The Basic Class Diagram  Class Name  Attributes (- indicates private each would have properties or accessor/mutator.

Slides:



Advertisements
Similar presentations
UML (cont.) “The Unified Modeling Language User Guide” by G. Booch, J. Rumbaugh and I. Jacobson ● Classes ● Relationships ● Class diagrams ● Examples.
Advertisements

Object-oriented modeling Class/Object Diagrams
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. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Object-Oriented.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
1 © Wolfgang Pelz UML3 UML 3 Notations describe how to use reusable software. Package Component Deployment Node.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Sharif University of Technology1 Design and Use-case Realization Software Engineering Laboratory Fall 2006.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
The Unified Modeling Language (UML) Class Diagrams.
An Object-Oriented Approach to Programming Logic and Design
Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model.
1 Java Inheritance. 2 Inheritance On the surface, inheritance is a code re-use issue. –we can extend code that is already written in a manageable manner.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Object-Oriented Modeling Chapter 10 CSCI CSCI 1302 – Object-Oriented Modeling2 Outline The Software Development Process Discovering Relationships.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
7-1 © Prentice Hall, 2004 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
7-1 © Prentice Hall, 2007 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
7-1 © Prentice Hall, 2007 Week 5: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
CS212: Object Oriented Analysis and Design Lecture 13: Relationship between Classes.
UML Diagrams: The Static Model Class Diagrams. The Static Model Define the static structure of the logical model Represent classes, class hierarchies.
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.
12 September, 2007Information System Design IT60105, Autumn 2007 Information System Design IT60105 Lecture 11 Class and Object Diagrams.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Class and Sequence diagrams UML notation SE-2030 Dr. Mark L. Hornick 1.
Design Model Lecture p6 T120B pavasario sem.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Chapter 12 Object-oriented design for more than one class.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 11 Object-Oriented.
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.
UML Class Diagram notation Indicating relationships between classes SE-2030 Dr. Mark L. Hornick 1.
Association / Aggregation / Composition and inheritance
Class diagrams Terézia Mézešová.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
 Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
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.
Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates.
Software Modelling Class Diagram. Class Diagrams The main building block in object oriented modeling They are used both for general conceptual modeling.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Object-Orientated Analysis, Design and Programming
Object Oriented Programming
UML Diagrams: Class Diagrams The Static Analysis Model
Structural Modeling.
OBJECT ORIENTED CONCEPT
EKT472: Object Oriented Programming
Chapter 11 Object-Oriented Design
Chapter 8 Analysis & Modeling
Object Oriented Concepts
UML Diagrams: The Static Model Class Diagrams
Object Oriented Analysis and Design
Domain Class Diagram Chapter 4 Part 2 pp
UML Class Diagram.
Semantic Objects.
Software Engineering Lecture 10.
Understand and Use Object Oriented Methods
Class Diagram.
The Object Paradigm Classes – Templates for creating objects
Software Design Lecture : 36.
ADVANCED OBJECT-ORIENTED PROGRAMMING
Presentation transcript:

CLASS DIAGRAMS A classy approach to objects

The Basic Class Diagram  Class Name  Attributes (- indicates private each would have properties or accessor/mutator methods)  Class Methods Customer ClassElements

Class Relationships  Classes have relationships with other classes  These fall into 4 different kinds  Associations  Inheritance (generalization/specialization)  Aggregation (parts to whole, where parts have a separate existence)  Composition (parts to a whole where the parts do not have a separate existence

Associations  Associations means that a class interacts with another class  A customer for instance interacts with a purchase  These associations can also contain a property called “multiplicity”  Multiplicity specifies how many instances of each class an association a class can have  For instance one customer can have many (1..* ) purchases, or one class can have 25 students (1..25)

Association Example

Inheritance  In Inheritance child classes inherit from a parent class  This means they get all the public properties and methods of the parent without having to rewrite them  Usually the parent is a generalized class that contains all the elements the child classes have in common, and the child classes represent more specialized instances of that general class

Inheritance Example

Aggregation  Aggregation exists when classes have a whole, part relationship but the parts have an independent existence of their own  For instance a company exists of many parts, but each of those parts can be treated as an object in themselves

Aggregation Example

Composition  Composition describes a relationship where the parts cannot have a separate existence from the whole.  An example is the.Net DataTable class. It contains the classes DataRow and DataColumn, but they can only exist in the DataTable class

Composition Example

Interfaces  Interfaces contain only method definitions.  They are often referred to as “contracts”  When a class implements an interface it “contracts” to provide an implementation for all the methods in the interface  Interfaces are useful for ensuring the consistency of some kinds of common functionality. A developer knows that if a class implements a particular interface then it will contain definitions for the interfaces methods

Interface Example Both classes must implement the three methods, as well as their own methods