CS 157A: Intro to Database SysEnhanced Entity-Relationship (EER) Modeling: Superclass/Subclass RelationshipInter-entity class relationshipIntra-entity class relationshipSuperclass and SubclassBasic Properties of SC/scNew EER diagram notation for SC/scSpecialization / GeneralizationMore SpecializationTotal/Partial CompletenessMore Specialization: MultiplePredicateSpecialization HierarchySpecialization LatticeCategorizationWhich EER Construct?AggregationTHE ENDCS 157A: Intro to Database SysSummary of Chapter Section 4.1 of the textbook Data Modeling and Database DesignCopyright 2007 Thomson Course TechnologyPresentation compiled by Michael Goebel2007 September 06Enhanced Entity-Relationship (EER)Modeling: Superclass/Subclass RelationshipGeneral Properties of Superclass/SubclassSpecialization and GeneralizationSpecialization HierarchySpecialization LatticeCategorizationAppropriate EER ConstructAggregationInter-entity class relationshipYou enter a store to buy a piece of furnitureStore and Furniture: different independent object types (aka entity types)Store has Furniture (has-a relationship)STORESellsFURNITUREIntra-entity class relationshipNeed to furnish your new apartmentYou want a table, chairs, bed, etc.These possess some common propertiesTable/Chair/Bed is Furniture (is-a relationship)FURNITURETABLECHAIRBEDSuperclass and SubclassNo relationship type between Furniture and Chair/Bed/TableFurniture can be many different thingsFurniture is Superclass (SC)Chair/Bed/Table is Subclass (sc)CHAIRBEDTABLEFURNITUREBasic Properties of SC/scA Superclass/Subclass relationshipOne Superclass is related to one or more SubclassesA Subclass entity only belongs to 1 SuperclassA Superclass entity can belong to 1 or more (or none) SubclassesSubclass inherits all attributes of SuperclassSubclass can have its own attributesCardinality ratio 1:1 is understood to existNew EER diagram notation for SC/scTotal completenessPartial completenessDisjoint SubclassOverlapping SubclassesUnion of SuperclassesAggregation of SubclassesIdentifies a SubclassdOUAUSpecialization / GeneralizationSpecialization is the process of discovering the distinguishing attributes of any subgroups and creating SubclassesSpecialization is a top-down approach to SC/scGeneralization is the process of gathering all the common attributes shared by a group of entities and creating a SuperclassGeneralization is a down-up approach to SC/scMore SpecializationInclusion of a Superclass in the specialization is called a Completeness ConstraintCompleteness Constraint can be either Total or PartialTotal Specialization: every entity of the Superclass participates in the specialization relationship (shown with a solid line)Partial Specialization: 1 or more entities of the Superclass participates in the specialization relationship (shown with a dash line)Total/Partial CompletenessSTUDENT_ATHLETEFOOTBALLBASEBALL BASKETBALLOTotal completenessPartial completenessUUUMore Specialization: MultipleSTUDENT_ATHLETEFOOTBALLBASEBALL BASKETBALLOTotal completenessPartial completenessUUUCAPTAINUTEAMPredicateHow to directly determine the membership of a SubclassThru the use of a defining predicateStudent_Athlete Subclass membership are Sport_TeamsSTUDENT_ATHLETEFOOTBALLBASEBALLOUUCAPTAINTEAMSPORT_TEAMSFOOTBALLUBASEBALLSpecialization HierarchyAlready know that a Superclass can have one or more SubclassesThose Subclasses themselves can become Superclasses of other SubclassesThe structure of Superclass-Subclass-Superclass-Subclass-etc. is limited to an inverted treeLimitation is that a Subclass can only be related to one Superclass specializationSpecialization LatticeSimilar to the Specialization Hierarchy where a child (Subclass) is only allowed on parent (Superclass specialization)The child (Subclass) is allowed to have 2 or more parents (Superclass) as long as each parent is from a different Specialization.The Subclass then inherits all the attributes and relationship types from each parent, Multiple Type InheritanceCategorizationThe idea that there is only one Superclass is the overriding characteristic of the Specialization/Generalization constructWhen many Superclasses and a Subclass are tied together by a single relationship type this is known as CategorizationThe Subclass is known as the CategoryAn entity which belongs to the Category must also exist in only one of the SuperclassesWhich EER Construct?When to use Specialization/Generalization or CategorizationNot always easy to know: subjective and context specificIf Superclasses share many common attributes with same properties then Specialization/Generalization might work bestIf Superclasses don't share much attributes but have a common category they could identify with, then Categorization might work bestAggregationAggregation (to combine) is similar to Categorization except that it must have Total CompletenessAggregation plays the “is a part of” in a SC/sc relationshipPCHARDWAREOP_SYSAUTHE
View Full Document