PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams.

Slides:



Advertisements
Similar presentations
DOMAIN MODEL SPECIAL ASSOCIATIONS – COMPOSITION AND INHERITANCE SYS466.
Advertisements

Object-oriented modeling Class/Object Diagrams
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall A.1.
Analysis and Design with UML
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Page 1  Copyright © 1997 by Rational Software Corporation Class Diagrams A class diagram shows the existence of classes and their relationships in the.
© Copyright Eliyahu Brutman Programming Techniques Course.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
Lecture a: Additional UML Models: Package, Activity, Deployment Lecture b: Generalization, Aggregation and Additional Domain Model Notation Copyright W.
Use Case Analysis – continued
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
Page 1 R Copyright © 1997 by Rational Software Corporation Analysis and Design with UML.
Unified Modeling Language
The Unified Modeling Language (UML) Class Diagrams.
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.
Page 1 What is the UML? UML stands for Unified Modeling Language The UML combines the best of the best from – Data Modeling concepts (Entity Relationship.
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Page 1  Copyright © 1997 by Rational Software Corporation Computer System Business Process Order Item Ship via “ Modeling captures essential parts of.
Page 1 R Copyright © 1998 by Rational Software Corporation Visual Modeling and the UML.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
1 UML Basic Training. UML Basic training2 Agenda  Definitions: requirements, design  Basics of Unified Modeling Language 1.4  SysML.
Lab 04.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Chapter 16 Applying UML and Patterns Craig Larman
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
Modeling system requirements. Purpose of Models Models help an analyst clarify and refine a design. Models help simplify the complexity of information.
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.
NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman.
SYS466: Analysis and Design Using OO Models Domain Class Diagram.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
What is a Structural Model?
Design Jon Walker. More UML ● What is UML again?
DOMAIN MODEL—PART 4B: SPECIAL ASSOCIATIONS - INHERITANCE BTS430 Systems Analysis and Design using UML.
Design Model Lecture p6 T120B pavasario sem.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Class Modeling Design Class diagram. Classes The term “class ” refers to a group of objects that share a common attributes and common behaviour (operations).
 Week08.  Review Schedule Weeks 8-14  This week o Review last class o Introduce Class Diagrams o ICE-03 Sheridan SYST Engineering Quality Systems.
Page 1 R Copyright © 1997 by Rational Software Corporation Analysis and Design with UML Presentation was downloaded (and is available for free) from Rational.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Domain Classes – Part 1.  Analyze Requirements as per Use Case Model  Domain Model (Conceptual Class Diagram)  Interaction (Sequence) Diagrams  System.
Database Design – Lecture 12 Object Oriented Database Design cont’d.
Page 1  Copyright © 1997 by Rational Software Corporation Putting the UML to Work The ESU University wants to computerize their registration system –
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Object-Oriented Systems Analysis and Design Using UML Systems Analysis and Design,
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
Object-Level Sequence Diagrams with Composition Relationships.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
Software Modelling Class Diagram. Class Diagrams The main building block in object oriented modeling They are used both for general conceptual modeling.
DOMAIN CLASSES – PART 1 BTS430 Systems Analysis and Design using UML.
1 Chapter 13: Class Diagram Chapter 19 in Applying UML and Patterns Book.
UML Diagrams: Class Diagrams The Static Analysis Model
Chapter 5: Structural Modeling
UML SEQUENCE AND CLASS DIAGRAMS
Object Oriented Analysis and Design
UML Class Diagram.
Chapter 20 Object-Oriented Analysis and Design
SYS466 Domain Classes – Part 1.
Object Oriented System Design Class Diagrams
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Chapter 11: Class Diagram
Presentation transcript:

PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams

Class Design  Analysis objects are things in the real world, e.g invoice, registration form, sales person  Design objects are logical constructs which may map to objects in the real world but which find their existence only in code

Transformation  Is the process of turning real world domain abstraction into an object in the model.  Every significant object in the domain analysis is a candidate for being transformed into one or more design objects (Noun Filter)

Class Diagrams  A class diagram shows the existence of classes and their relationships in the logical view of a system  UML modeling elements in class diagrams Classes and their structure and behavior Association, aggregation, and inheritance relationships Multiplicity and navigation indicators

Copyright © 1997 by Rational Software Corporation Relationships  Relationships provide a pathway for communication between objects  Sequence and/or collaboration diagrams are examined to determine what links between objects need to exist to accomplish the behavior -- if two objects need to “talk” there must be a link between them  Types of relationships are: Association Aggregation

Copyright © 1997 by Rational Software Corporation Relationships  An association is a bi-directional connection between classes An association is shown as a line connecting the related classes  An aggregation is a stronger form of relationship where the relationship is between a whole and its parts An aggregation is shown as a line connecting the related classes with a diamond next to the class representing the whole

Copyright © 1997 by Rational Software Corporation Registration Manager Math 101: Course 3: add student(joe) RegistrationManager Course Finding Association Relationships  Relationships are discovered by examining interaction diagrams If two objects must “talk” there must be a pathway for communication

Copyright © 1997 by Rational Software Corporation Multiplicity and Navigation  Multiplicity defines how many objects participate in a relationships Multiplicity is the number of instances of one class related to ONE instance of the other class For each association and aggregation, there are two multiplicity decisions to make: one for each end of the relationship

Aggregations An aggregation is  a special kind of association  the composition of a set of parts—a whole- part relationship  a “has a” or “consists of” relationship

Aggregations Examples:  An invoice has invoice items  A company has contacts

Aggregate Class Component Class Aggregation Symbol

Proxy  Is an object in the design which represents key aspects of a real world entity Also called a surrogate  First create proxy for all the actors in the system, e.g. customer, guest  Then for many of the real world objects, e.g, invoice, receipt, reservation

Aggregations Essential property  The aggregate (Invoice) acts as a proxy for its parts (InvoiceItem)  This means the aggregate takes on operations which are then propagated to the individual parts. (These operations don’t necessarily cause a change in the aggregate itself.)

Here adding a ContactPerson does not change the proxy (Company).

Here adding an InvoiceItem does change the proxy (Invoice). Its totals are updated.

Aggregations Aggregation vs Association  In contrast to the association, the involved classes do not maintain an equal relationship but the aggregate class assumes a special role for delegation of responsibility and leadership

Multiplicity in Aggregation  Generally a 1:M relationship The aggregate will be the 1 The parts will be the many 1…n

Aggregation  Can describe a relationship where the parts are existence-dependent on the whole. If the whole is deleted, the individual parts will be deleted. If an individual part is deleted, the aggregate will survive.

Composition Composition is a strict form of aggregation.  The life of the parts is subordinate to the whole. The parts are generated together with the aggregate or later. Parts are destroyed before the whole

Composition  The component parts depend on the aggregate for existence—delete the aggregate and the components disappear (this is called a cascading delete)

Composition Which of these might be composition?  An invoice has invoice items  A company has contacts  A catalogue has catalogue items  An MSWord document style has a font, a language, a paragraph control, and so on…

When we delete Invoice, does InvoiceItem disappear? Yes! It has no meaning without Invoice. To indicate a composition, the diamond is coloured black.

When we delete Company, does ContactPerson disappear? Yes! It has no meaning without Company.

When about Catalogue and CatalogueItem? If CatalogueItem belongs to only one catalogue and it is the intersection between that Catalogue and an Item then yes, it would disappear if Catalogue were deleted and we would have a composition relationship. But note the Item itself would not disappear!

This sequence diagram shows the proxy relationship of Catalogue to CatalogueItem

This sequence diagram shows an example of the cascading delete that identifies Composition.

Aggregations Aggregation vs Association  Useful in modeling—an aggregation shows where there is higher binding between classes which in turn makes models easier to understand  Aggregation helps determine implementation (e.g. arrays, etc.)  When in doubt use an association

Copyright © 1997 by Rational Software Corporation Inheritance  Inheritance is a relationships between a base class and its derived classes  There are two ways to find inheritance: Generalization Specialization  Common attributes, operations, and/or relationships are shown at the highest applicable level in the hierarchy

Inheritance  Generalization Identify similar structure and behaviour among classes  Specialization Identify a parent class--how can it be “specialized” for use in other parts of the system?

Inheritance  Inheritance is a “generalization” relationship  The base class (parent class, super class) carries a certain set of characteristics (attributes, operations, relationships)  The derived classes (child classes, sub classes) inherit those characteristics plus they have some of their own

Inheritance  A child class “is a” special type of the more general parent class  E.g. “A video is a type of library item” “A part-time student is a type of student” “A reserve item screen is a type of library screen”

Why Inheritance? Why do we care about inheritance?  Less duplication  More reusability  More standardization  Less change impact  Classes are more focused

Inheritance  Structures showing inheritance are called Inheritance Hierarchies

How do you find inheritance?  Look for classes that share many operations, attributes (But be careful! Don’t create false inheritance!)  Look for actions or text (i.e. in specs) that imply that there are several types of objects in a class--investigate further.

Copyright © 1997 by Rational Software Corporation Inheritance Generalization The capability to create base classes that encapsulate structure and behaviour common to several classes.

Inheritance Generalization:  Here we see similar structure and behaviour among classes

Inheritance Generalization:  Now we create a parent class

Inheritance Generalization:  Now we move all common elements from children to parent and we draw the inheritance relationship

Copyright © 1997 by Rational Software Corporation Inheritance Specialization The ability to create derived classes that represent refinements to the base class—typically structure and behaviour are added to the new derived class.

Inheritance  In Rational Rose you need to set Parent attributes as PROTECTED instead of private

Inheritance  You will see the inherited operations and attributes only in the specification window not in class diagrams

Inheritance  A critical aspect of public inheritance is that it should model specialization/ generalization and nothing else.

Base Classes and Derived Classes  Derived classes must know who their base class is, and they depend on their base class.  Base classes should know nothing about their derived classes.

Class Design  Build the inheritance hierarchy  Map use cases to object interaction  Delegate every responsibility of the system to a specific object  Fully understand the collaboration between objects  Create a blueprint for your implementation