Subtypes Copyright © 1999 Patrick McDermott UC Berkeley Extension

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

Advanced Data Modeling
© Shamkant B. Navathe CC. © Shamkant B. Navathe CC Chapter 4 - Part I Enhanced Entity-Relationship and UML Modeling Copyright © 2004 Ramez Elmasri and.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 5 Advanced Data Modeling.
Chapter 6 Advanced Data Modelling
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1.
Copyright W. Howden1 Lecture 11: UML Terminology and Additional Models and Notation.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 4 Enhanced Entity-Relationship (EER) Modeling.
1 Database Systems: A Practical Approach to Design, Implementation and Management International Computer Science S. Carolyn Begg, Thomas Connolly Lecture.
Lecture a: Additional UML Models: Package, Activity, Deployment Lecture b: Generalization, Aggregation and Additional Domain Model Notation Copyright W.
1 Enhanced Entity Relationship Modelling EER Model Concepts Includes all basic ER modeling concepts Additional concepts: subclasses/superclasses specialization/generalization.
Chapter Five Data Modeling with the Entity-Relationship Model.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
CSCI 242 Relational Data Modeling Copyright 2011, David C. Roberts, all rights reserved.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1 EER stands for Enhanced ER or Extended ER EER Model Concepts Includes all modeling concepts.
Enhanced Entity-Relationship and UML Modeling. Enhanced-ER (EER) Model Concepts Includes all modeling concepts of basic ER Additional concepts: subclasses/superclasses,
Enhanced Entity-Relationship Model (EER) 1. Enhanced-ER (EER) Model Concepts Includes all modeling concepts of basic ER Additional concepts: subclasses/superclasses,
The Entity-Relationship Model. 421B: Database Systems - ER Model 2 Overview of Database Design q Conceptual Design -- A first model of the real world.
Class Agenda – 04/04/2006 Discuss database modeling issues
Data Modeling 101 UC Berkeley Extension Copyright © 2000 Patrick McDermott
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented Design.
UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
Natural vs. Generated Keys. Definitions Natural key—a key that occurs in the data, that uniquely identifies rows. AKA candidate key. Generated key—a key.
© Shamkant B. Navathe CC. © Shamkant B. Navathe CC Chapter 4 - Part I Enhanced Entity-Relationship and UML Modeling Copyright © 2004 Ramez Elmasri and.
The Relational Model UC Berkeley Extension Copyright © 2008 Patrick McDermott.
THE ENHANCED ER (EER) MODEL CHAPTER 8 (6/E) CHAPTER 4 (5/E)
IS 475/675 - Introduction to Database Design
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
Domain Modeling Part2: Domain Class Diagram Chapter 4 pp part 2 1.
CSC271 Database Systems Lecture # 25. Summary: Previous Lecture  Structural constraints  Multiplicity  Cardinality  Participation  Connection traps.
The Ontology of Objects in Inheritance Copyright © 2006 Patrick McDermott UC Berkeley Extension
PROG Object Oriented Programming II With Java PROG Object Oriented Programming II With Java Class Relationships.
CRAM/ERAT Babel College of Alameda Copyright © 2000 Patrick McDermott CRAM: Class-Relationship-Attribute-Method ERAT: Entity-Relationship-Attribute-Trigger.
Enhanced Entity-Relationship and Object Modeling Chapter 4
Enhanced Entity-Relationship (EER) Modeling. Slide 4- 2 Chapter Outline EER stands for Enhanced ER or Extended ER EER Model Concepts Includes all modeling.
Database Systems Supertypes and Subtypes Lecture # 10.
Entity Relationship Modeling
Relationships Copyright © 1999 Patrick McDermott UC Berkeley Extension Mary Cassatt (1844–1926) Mother and Child against a Green Background.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Database Systems: Design, Implementation, and Management Ninth Edition
Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1.
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Ramez Elmasri and Shamkant Navathe Enhanced-ER (EER) Model Concepts.
Exam 1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas.
© Shamkant B. Navathe CC Enhanced Entity-Relationship Copyright © 2004 Ramez Elmasri and Shamkant Navathe.
Basic ER modeling was adequate for simpler databases, but in the 1980’s more demanding databases required more extensive modeling requirements. Some such.
Database vs File System Integrated Data Reduced Data Duplication Program/Data Independence Easier representation for user Separate/Isolated data Appl.
3/1/01H-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Evaluating Class Diagrams Topics include: Cohesion, Coupling Law of Demeter (handout)
Lecture 3 A short revision of ER and EER modelling See R. Elmasri, S.B. Navathe. Fundamentals of Database Systems (third edition) Addison-wesley. Chapter.
Enhanced Entity-Relationship and UML Modeling. 2.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 4- 1.
Chapter 4_part2: The Enhanced Entity-Relationship (EER) Model.
Data Modeling Advanced Concepts Updated 20/4/2015 TMC2034 Database Concept and Design1.
BTM 382 Database Management Chapter 5: Advanced Data Modeling
Enhanced Entity-Relationship (EER) Model
The Enhanced Entity- Relationship (EER) Model
Enhanced Entity-Relationship and Object Modeling Objectives
The Enhanced Entity- Relationship (EER) Model
Session 2 Welcome: The sixth learning sequence
UML UML to Relations.
UML Class Diagrams: Basic Concepts
Domain Class Diagram Chapter 4 Part 2 pp
UML UML to Relations.
MBA 664 Database Management
Sampath Jayarathna Cal Poly Pomona
Sampath Jayarathna Cal Poly Pomona
Presentation transcript:

Subtypes Copyright © 1999 Patrick McDermott UC Berkeley Extension

Inheritance  CRC Cards : Superclass/Subclass  ERD : Supertype/Subtype  Relational : N/A  Database : Three Variations  Programmer : Base/Derived  UML : Generalization/Specialization  Etc., etc., etc. …: Is-a, Root/Branch/Leaf, Extension

Types of Relationship IS-A: Generalization HAS-A: Aggregation IS-Made-From: Composition –“A form of aggregation with strong ownership and coincident lifetime of parts by the whole.” – Rumbaugh, Reference, p. 226 –I don’t bother distinguishing from Aggregation USES: Association –Default; those that aren’t one of the others –Usually Name according to Use

Subtype A subtype is a subtype of another entity (supertype) where occurrences of both designate the same object in the real world, but the subtype has additional, more specific properties. The primary key of a subtype should be the same as the primary key of the supertype

Analogies Base/Derived –Generalization: General-Specific –Genus Species Supertype-Type-Subtype –Superclass-Subclass Tree –Root-Branch-Leaf Inheritance –Parent-Child [Cloned] “Is a” –“A Kind of” Pietr Brueg(h)el (the Elder) The Tower of Babel, 1563

Teacher TEACHER Name Address Telephone Salary GetPaid() GetHired() Quit() PartTime Hours Contract() Block Arrow:

Instead of Inheritance Sometimes you DO want to inherit, sometimes you don’t. or just some…  Delegation  Composition  Aggregation Says can use to avoid violating LSP: BUT it just avoids inheritance. In the end, they look the same in the database…

Super Type Confusion More attributes means Fewer Objects Supertype is subset of type... If you understand the set theory from which it comes, no (new) confusion This has something more, else it would be in the larger category

Employee EMPLOYEE Name Address Telephone GetHired() GetPaid() Transfer() Quit() BlueCollar HourlyRate Union GetPaid() PayUnion() Grieve() WhiteCollar Salary GetStock() Block Arrow:

Should You Subclass? Different times Different users Different behavior If overlap a lot, don’t subclass

A Difference in Degree, or Kind?   ’s fields 1 Record 2 Record Types 3 Records  ’s fields  ’s fields common fields   ’s fields  ’s fields common fields Used Only By  s Used Only By  s Or Type  Type  Plain Type

K.I.S.S. There must be a Business Need –A Distinction without Difference –A difference is a difference only if it makes a difference Analogies aren’t exact Too many levels can be confusing Multiple Inheritance can be confusing When in doubt, leave it out –Anything that can be done with inheritance can be done without