MORE ON CLASS MODELS Lecture 22. 2 Outline Aggregation and composition Roles Navigability Qualified association Derived association Constraints Association.

Slides:



Advertisements
Similar presentations
Unified Modeling Language Philip Liew
Advertisements

1 CIS224 Software Projects: Software Engineering and Research Methods Lecture 4 Class Models (Based on Fowler (2004, Chapters 3 & 5) and Stevens and Pooley.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 Class and Object Diagrams PRACTICAL OBJECT-ORIENTED DESIGN WITH.
Software Engineering COMP 201
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Essentials of class models. 2 A very simple class model In UML, a class is shown in a class diagram as a rectangle giving its name.
Essentials of interaction diagrams Lecture 23 & 24.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
Essentials of state and activity diagram Lecture 24.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
IMSE 11 - UML Class Diagrams
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 Class and Object Diagrams PRACTICAL OBJECT-ORIENTED DESIGN WITH.
Sharif University of Technology1 Design and Use-case Realization Software Engineering Laboratory Fall 2006.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
CS 494 Adv. SW Design and Development
1 ODB Design Handling Associations in ODL M. Akhtar Ali School of Informatics.
Object-Oriented Analysis and Design
Relationships. In the Interaction diagrams, we began to look at how classes communicate with one another. Now, we'll focus on the relationships between.
Association & Aggregation Lecture-9. Vehicle Car Tyre Engine Bus Passenger.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Chapter 5 Entity–Relationship Modeling
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
Lab 04.
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.
Models as System Views UML models present different views of systems Evolution of system effected by evolving models (views) –Requires well defined relationships.
7-1 © Prentice Hall, 2007 Week 5: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Unit 1 INTRODUCTION TO MODELING AND CLASS MODEL Ref : L7-UML.PDF.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
INFO 620Lecture #81 Information Systems Analysis and Design Class Diagram Refinement INFO 620 Glenn Booker.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 03. Classes,
Engineering 5895: Software Design 9/11/01Class Diagrams 1.
1 CMPT 275 Software Engineering Requirements Analysis Phase Requirements Analysis activity Janice Regan,
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.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Advanced UML Class Diagrams.
1 Kyung Hee University Class Diagrams Spring 2001.
1 Kyung Hee University Constraints Spring Kyung Hee University Graphical Notations  Graphical notations are well suited for displaying structural.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 5 INTRODUCTION TO SYSTEMS ANALYSIS AND DESIGN: AN AGILE, ITERATIVE APPROACH CHAPTER.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
Database Design – Lecture 12 Object Oriented Database Design cont’d.
Chapter 3 Class Diagrams. 2 Outline Class Basics Class Basics Classes Classes Association Association Multiplicity Multiplicity Inheritance Inheritance.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
UML Class Diagram notation Indicating relationships between classes SE-2030 Dr. Mark L. Hornick 1.
UML Part 1: Class Diagrams. Introduction UML stands for Unified Modeling Language. It represents a unification of the concepts and notations presented.
Chapter 16: UML Class Diagrams
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
Winter 2007SEG2101 Chapter 31 Chapter 3 Requirements Specifications.
Capturing Requirements. Questions to Ask about Requirements 1)Are the requirements correct? 2)Consistent? 3)Unambiguous? 4)Complete? 5)Feasible? 6)Relevant?
® IBM Software Group © 2007 IBM Corporation Module 3: Creating UML Diagrams Essentials of Modeling with IBM Rational Software Architect, V7.5.
CLASS DIAGRAMS A classy approach to objects. The Basic Class Diagram  Class Name  Attributes (- indicates private each would have properties or accessor/mutator.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
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.
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Appendix A: UML Java Software Structures: Designing and Using Data.
IBM Rational Rhapsody Advanced Systems Training v7.5
Analysis Classes Unit 5.
Object-Orientated Analysis, Design and Programming
Business System Development
Visit for more Learning Resources
UML Class Diagrams (more notation)
Class Diagrams.
UML Class Diagrams: Basic Concepts
Software Engineering Lecture #11.
Object Oriented Analysis and Design Using the UML
Understand and Use Object Oriented Methods
Chapter 11: Class Diagram
Presentation transcript:

MORE ON CLASS MODELS Lecture 22

2 Outline Aggregation and composition Roles Navigability Qualified association Derived association Constraints Association classes

3 Aggregation and composition Aggregation and composition are kinds of association: –Instead of just showing that two classes are associated we may choose to show more about what kind of association this is Aggregation and composition are both ways of recording that an object of one class is part of an object of another class.

4 Module is a part of an HonoursCourse The notation with open diamond, denotes aggregation, which is more general way of denoting a part-whole relationship in UML

5 Aggregation is essentially a conceptual notion: –seeing an aggregation in a class model should help you to understand the relationships between the classes at an informal level BUT does not give you any more formal information about how they must be implemented or what you can do with them

6 Composition Composition is a special kind of aggregation which does impose some further restrictions. In composition association, the whole strongly owns its parts –If the whole object is copied or deleted, its parts are copied or deleted with it The multiplicity at the whole end of a composition association must be 1 or 0..1 –A part cannot be part of more than one whole by composition

7 Example Noughts and Crosses (Tic-Tac-Toe) Composition is shown just as aggregation is, except that diamond is filled in

8 Roles Often you can read an association name in both directions (‘is taking’,’is taken by’) Sometimes, however, it is more readable to have separate names for the roles that the objects play in the association.

9 Association with no navigability The diagram records that: –For each object of class Student there are six objects of class Module which are associated with the Student; –For each object of class Module there are some Student objects (the number of students is unspecified) associated with the Module.

10 Navigability We can put an arrow on one or both ends of the association line to represent that it is possible for messages to be sent in the direction of the arrow We say that Module knows about Student, but not vice versa.

11 Qualified associations Occasionally it is helpful to give finer detail about an association than we have so far. Square is identified relative to the board it’s on by attributes raw and column, each taking a value between 1 and 3

12 Qualified composition In fact we can combine the qualified association notation with the other adornments on associations For example, we can add back the information that this particular association is a composition

13 Derived associations Derived association exists automatically once we have implemented the main association A derived association as shown using a slash in front of its name The black triangles indicate which direction of the association the name describes.

14 Constraints A constraint is a condition that has to be satisfied by any correct implementation of a design The formal constrains can be written in OCL, the Object Constraint Language (developed by IBM) OCL is intended to be –Formal, so that constraints written in it are unambiguous –Easy to use, so that every developer can write constraints in it

15 The xor constraint is not written in OCL, it’s a special predefined constraint which is part of UML Each copy object represents either a copy of Book or a copy of Journal

16 Association classes Think which is both an association and a class, which is unsurprisingly called an association class

17 Avoiding an association class