Class Relationships Lecture Oo07 Generalization Relationships.

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

OO Programming in Java Objectives for today: Overriding the toString() method Polymorphism & Dynamic Binding Interfaces Packages and Class Path.
Object Oriented Programming
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.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Unified Modeling Language
Inheritance Inheritance Reserved word protected Reserved word super
Advanced Programming in Java
Sadegh Aliakbary Sharif University of Technology Fall 2010.
– Advanced Programming P ROGRAMMING IN Lecture 16 Interfaces.
ITEC200 – Week03 Inheritance and Class Hierarchies.
Together and UML Greg Johnson CSE 230 – Software Engineering Spring 2007.
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
Basic OOP Concepts and Terms
© Wolfgang Pelz Introduction Object-Oriented Methods: Analysis, Design & Programming Dr. Wolfgang Pelz Dr. Yingcai Xiao The University of Akron.
Object-Oriented Analysis and Design
CSE 331 Software Design & Implementation Hal Perkins Autumn 2012 Java Classes, Interfaces, and Types 1.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Construction Lecture Oo20 Gymnastics System Example Cont’d.
A Development Process Lecture Oo13 Objectory based method.
Class Diagram Notation Lecture Oo12 Classes Packages.
Unified Modeling Language, Version 2.0
3rd Country Training, K.Subieta: System Engineering and Databases. Lecture 3, Slide 1 February 20, 2004 Lecture 3: Introduction to Software Analysis and.
Class Relationships Lecture Oo10 Dependencies. References n Booch, et al, The Unified Modeling Language User Guide, Chapt 5 p.69, Chapt 9 130, Chapt 10.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 27. Review UML dynamic view – State Diagrams.
Slide 1 Structural Modeling Chapter 7. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
Guided Notes Ch. 9 ADT and Modules Ch. 10 Object-Oriented Programming PHP support for OOP and Assignment 4 Term project proposal C++ and Java Designer.
A little bit of UML Csaba Veres. UML A de facto standard for OO analysis and design Many components class diagrams use cases interaction diagrams...
Today in OOAD  The Domain Model Artifact UML Classes  EU-Bid Domain Model Exercise  EU-Lease Domain Model Assignment Guest Speaker  Kate Cunningham,
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.
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.
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
Lecture OO05 Object Scenarios Object Interaction Diagrams
Week III  Recap from Last Week Review Classes Review Domain Model for EU-Bid & EU-Lease Aggregation Example (Reservation) Attribute Properties.
Design Model Lecture p6 T120B pavasario sem.
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
CS2110: SW Development Methods Inheritance in OO and in Java Part 2: Topics: Forms of inheritance Interfaces in Java.
OBJECT ORIENTED AND FUNCTION ORIENTED DESIGN 1 Chapter 6.
Domain Classes – Part 1.  Analyze Requirements as per Use Case Model  Domain Model (Conceptual Class Diagram)  Interaction (Sequence) Diagrams  System.
Lecture 10 Concepts of Programming Languages Arne Kutzner Hanyang University / Seoul Korea.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Topics Inheritance introduction
Class diagrams Terézia Mézešová.
 Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and.
Use Case Diagrams Lecture Oo14 Use Cases. References n Booch, et al, The Unified modeling Language User’s Guide, AWL, 1999, Chapt 16 & 17 n Fowler & Scott,
© 2007 Lawrenceville Press Slide 1 Chapter 9 Inheritance  One class is an extension of another.  Allows a class to define a specialized type of an existing.
04 - OOD Intro.CSC4071 Software Design ‘Requirements’ defines –The goals the system needs to satisfy. ‘Specification’ defines –The externally-observable.
Terms and Rules II Professor Evan Korth New York University (All rights reserved)
Class Relationships Lecture Oo08 Polymorphism. References n Booch, et al, The Unified Modeling Language User Guide, Chapt 10 p.125 n Fowler & Scott, UML.
TK2023 Object-Oriented Software Engineering CHAPTER 11 CLASS DIAGRAMS.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
1 SYS366 Week 2 - Lecture 2 Visual Modeling & UML.
DOMAIN CLASSES – PART 1 BTS430 Systems Analysis and Design using UML.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2006 Classes and Objects Patrick Bailey Keith Vander Linden Calvin College.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Programming in Java: lecture 7
Modern Programming Tools And Techniques-I
Design Patterns: MORE Examples
The Movement To Objects
Lecture 12 Inheritance.
Unified Modeling Language—UML A Very Brief Introduction
Introduction to the Unified Modeling Language
Interface, Subclass, and Abstract Class Review
Introduction to the Unified Modeling Language
SYS466 Domain Classes – Part 1.
Basic OOP Concepts and Terms
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Lecture 10 Concepts of Programming Languages
The Object Model Lecture OO02 Classes as Abstract Data Types
Presentation transcript:

Class Relationships Lecture Oo07 Generalization Relationships

References n Ambler, S., The Object Primer, Cambridge Univ. Press, 2001, Section 5.6 n Fowler & Scott, UML Distilled Applying the Standard Object Modeling Language, AWL, 1997, Chapt 4,

Teaching Points n Generalization Relationships n Multiple Inheritance n Base-class resolution

Review n What good are different architectural views? n What view do Object Interaction Diagrams give?

Class Diagrams n Provide a static view of the design n The types of objects in the design and the static relationship between them n Three perspectives –Conceptual –Specification –Implementation

Conceptual Perspective n Concepts in the domain under study n Related to classes in the final solution but not directly n Here we are really describing the problem domain

Specification n A view of the software design but an abstract perspective n Looking at interfaces n Therefore we are describing types n Type and Interface go together

Implementation n A view which can describe the secrets of a class n The data structures may be visible in this view n Classes are being described (state and interface)

Generalization (Inheritance) n The “kind-of” relationship n Used to exploit the commonality of objects n The primary vehicle for “reuse” in OO n Super-class/Sub-class n Base-class/Derived-class

Generalization

What is a sub-class? n A subclass IS everything its base class is n A subclass can extend the base-class with new secrets/state n A subclass can extend the base-class with new interface/behavior n A subclass can mask/change a specific behavior of the base-class

Various Perspectives n Conceptual –One thing is a special kind of another thing –Everything we can say about the general thing is true of the specialized thing

Various Perspectives n Specification –sub-typing (interface-inheritance) –interface of the more specialized thing must contain all of the elements of the interface of the more general thing –sub-type conforms to the super-type’s interface

Various Perspectives n Implementation –sub-classing (implementation-inheritance) –generalization becomes inheritance as it is associated with programming languages –sub-class inherits all the methods and fields of the super-class

Multiple Inheritance

Abstract Classes n Are objects normally instantiated from every class in a system?

Mixin Classes

Ambiguity n What happens to common state/methods of the shared base- class? n It is not obvious whether base-class state/methods should be shared or be replicated n Example

Resolving Ambiguity n C++ mechanisms –Scope resolution operator –Virtual Inheritance

Teaching Points n Generalization Relationships n Multiple Inheritance n Base-class resolution