Generalization (Ch 26) a generalization is a relationship between a general thing (the superclass or parent class) and a more specific kind of thing (the.

Slides:



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

1 Generalizations Multiple Inheritance (finishing up Class Design) Class Design – Another Look – Part 11.
1 CIS224 Software Projects: Software Engineering and Research Methods Lecture 4 Class Models (Based on Fowler (2004, Chapters 3 & 5) and Stevens and Pooley.
CS 106 Introduction to Computer Science I 04 / 11 / 2008 Instructor: Michael Eckmann.
Ch 12: Object-Oriented Analysis
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Jan 2003Ron McFadyen Generalization (Ch 26) a generalization is a relationship between a general thing (the superclass or parent class) and a.
November R McFadyen1 Aggregation and Composition – section 27.2 both are associations used to denote that an object from one class is part.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1.
Chapter 2: Entity-Relationship Model (Continued)
3/15/05H-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Evaluating Class Diagrams Topics include: Cohesion, Coupling Law of Demeter (handout)
PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams.
Object Oriented Programming: Inheritance Chapter 9.
Lawrence ChungCS6359.0T1: Module 41 Module 4: Relationships.
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.
Entity-Relationship Model
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 8 Slide 1 Chapter 9 Structuring System Data Requirements.
1 Chapter 2 (Cont.) The BA’s Perspective on Object Orientation.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part V: Design The Design Workflow Design Classes Refining Analysis Relationships.
R McFadyen Chapter 7 Conceptual Data Modeling.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
Domain Modeling Part2: Domain Class Diagram Chapter 4 pp part 2 1.
Conceptual Modeling Modeling the Problem Domain. Conceptual Modeling Decompose problem space into comprehensible concepts. Clarify the terminology or.
INFO 620Lecture #81 Information Systems Analysis and Design Class Diagram Refinement INFO 620 Glenn Booker.
Domain Model Refinement Larman, chapter 31 CSE 432: Object-Oriented Software Engineering Glenn D. Blank, Lehigh University.
CS212: Object Oriented Analysis and Design Lecture 13: Relationship between Classes.
Sept Ron McFadyen1 Class Diagram Begins as a conceptual or analysis class model and evolves to a design class model Used throughout the development.
Design Model Lecture p6 T120B pavasario sem.
Repetition af Domæne model. Artifact influence emphasizing the Domain Model.
Enhanced Entity-Relationship (EER) Modeling. Slide 4- 2 Chapter Outline EER stands for Enhanced ER or Extended ER EER Model Concepts Includes all modeling.
Object Oriented Analysis and Design Class and Object Diagrams.
Class Modeling Design Class diagram. Classes The term “class ” refers to a group of objects that share a common attributes and common behaviour (operations).
Java Programming Dr. Randy Kaplan. Abstract Classes and Methods.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
OO Methodology Elaboration Iteration 3 – Part 1 Refining Models.
January Ron McFadyen1 Domain Models Domain Model: a visual representation of conceptual classes or real-world objects in a domain of interest.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
Sept 2004Ron McFadyen Generalization (Ch 26) a generalization is a relationship between a general thing (the superclass or parent class) and a.
2007ACS-3913 Ron McFadyen1 Generalization a generalization is a relationship between a general thing (the superclass or parent class) and a more specific.
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) Modern Database Management 11 th Edition Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson.
2007ACS Ron McFadyen1 Aggregation and Composition both are associations used to denote that an object from one class is part of an object of another.
Domain Model Refinement Notation Extensions. Things not seen before in the Domain Model Similar to the concepts in the Object Models Generalization and.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
Jan 2005Ron McFadyen Qualified Associations ProductCatalogueProductDescription A one to many association can be altered in a diagram to a one.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 4- 1.
Object Oriented Programming: Inheritance Chapter 9.
Chapter 2: Entity-Relationship Model
Enhanced Entity-Relationship (EER) Model
EKT472: Object Oriented Programming
Entity-Relationship Model
Domain Model Refinement
Lecture 14 - Abstract Classes
Domain Class Diagram Chapter 4 Part 2 pp
Unified Modelling Language
a generalization is a relationship between a general thing (the
Domain Modeling.
Domain Modeling.
Enhanced Entity-Relationship (EER) Modeling
a generalization is a relationship between a general thing (the
CGS 2545: Database Concepts Summer 2006
Presentation transcript:

Generalization (Ch 26) a generalization is a relationship between a general thing (the superclass or parent class) and a more specific kind of thing (the subclass or child class) example: a MemberOfStaff is a specialized kind of LibraryMember LibraryMember MemberOfStaff

Generalization example continued: everything a LibraryMember can do, a MemberOfStaff can do a LibraryMember can borrow a book, so can a MemberOfStaff there are some things that a MemberOfStaff can do that a LibraryMember cannot (the specialization aspect) the MemberOfStaff has all the attributes the LibraryMember has, and possibly more (again, the specialization aspect) LibraryMember MemberOfStaff

a Generalization example: a SavingsAccount is a specialized kind of BankAccount a ChequingAccount is a specialized kind of BankAccount an Asset may be a BankAccount, RealEstate, or a Security Asset RealEstateBankAccountSecurity SavingsAccountChequingAccount

Text: All members of a conceptual subclass set are members of their superclass set 100% of the conceptual superclass’s definition should be applicable to the subclass. The subclass must conform to 100% of the superclass’s: attributes associations A conceptual subclass is a kind of superclass - is-a-kind-of is usually referred to as is-a

Figure 26.7 Payment Amount: money Cash Payment Credit PaymentCheque Payment Sale Pays-for 1 1 Every payment, regardless of whether it is cash, credit, or cheque, has an Amount and it is associated with a Sale CreditCardCheque *

Motivation for partitioning a conceptual class into subclasses: the subclass has additional attributes of interest the subclass has additional associations of interest the subclass is operated on, handled, reacted to, or manipulated differently than the superclass or other subclasses the subclass concept represents an animate thing that behaves differently than the superclass or other subclasses Examples a chequing account will accrue interest differently from a savings account a loan account will have different associations from a savings account

Figure The name Payment is italicized - meaning it is an abstract class It will never be instantiated - only its subtypes will exist

Figure 26.7 Payment Amount: money Cash Payment Credit PaymentCheque Payment Sale Pays-for 1 1 Credit and Cheque participate in other associations CreditCardCheque *

Watch for objects that are performing roles, or moving from one state to another. ROT: Do not model with subclasses. Model with states. Text: Consider payments that begin as unauthorized and may eventually become authorized. Do not model as: Payment Unauthorized Payment Authorized Payment

Text: Instead of Payment Unauthorized Payment Authorized Payment Use: PaymentState Unauthorized StateAuthorized State Payment Is-in 1 1 Figure 26.13

Ch 27 - Refining the Domain Model 27.1 Association Classes 27.2 Aggregation and Composition 27.4 Association Role Names 27.5 Roles as Concepts vs Roles in Associations 27.6 Derived Elements 27.8 Reflexive Associations

Aggregation and Composition both are associations used to denote that an object from one class is part of an object of another class HonoursProgrammeCourse An example of Aggregation: a course is part of an honours programme. The same module could be part of several honours courses “Software Engineering with Objects and Components 2” is part of both the “Software Engineering” and the “Computer Science” honours programmes

Aggregation and Composition BoardSquare Composition is similar to, but stronger than aggregation. If you specify composition, then you are saying that one object owns its parts. A Board is made up of several Squares. A Square will belong to just one Board. If a Board is deleted, then its Squares are deleted too.

Aggregation and Composition InvoiceInvoiceLine Consider Invoices and their Invoice Lines Question: Is the association aggregation or composition? ? ?

Aggregation and Composition Figure 27.6

Association Class When we want to treat an association as a class (it has data or associations itself), we introduce an Association Class Figure: 27.3: Business rule: a store has a different merchant ID for each service

Top of Figure 27.4 (ignore rest of it) Many to many associations likely candidate for an Association Class limitation above: each person has at most one association with each company - we’ll re-examine this later when we look at history

Figure Can be very accurate: one person plays more than one role More difficult to implement: may need to mutate an object from one class to another