130 likes | 279 Views
Supertypes and Subtypes. One of the major challenges in data modeling is to recognize and clearly represent entities that are almost the same; that is, entity types that share common properties but also have one or more distinct properties that are of interest to the organization."SupertypeSubtyp
E N D
2. Chapter 4: The Enhanced E-R Model and Business Rules
3. Supertypes and Subtypes “One of the major challenges in data modeling is to recognize and clearly represent entities that are almost the same; that is, entity types that share common properties but also have one or more distinct properties that are of interest to the organization.”
Supertype
Subtype
?
4. Attributes Subtypes inherit all supertype attributes
Subtypes have attributes that are different from other subtypes
?
5. When to use Super/Subtypes Attributes apply to some but not all instances of an entity
Instances of a subtype participate in relationships unique to that subtype
Generalization and specialization
generalization: from sub to super
specialization: from super to sub
?
6. Constraints Completeness
must every supertype member also be a subtype member?
total or partial specialization
Disjointedness
can an instance of a supertype be in more than one subtype?
disjoint or overlap
subtype discriminator
Boolean attribute
?
7. Hierarchies Subtypes can be supertypes as well
a subtype is subordinate to one and only one supertype … a supertype can have many subtypes
Attributes are assigned at the highest possible level
Subtypes inherit attributes from all supertypes above them in the hierarchy
?
8. Business Rules “A business rule is a statement that defines or constrains some aspect of the business. It is intended to assert business structure or to control or influence the behavior of the business.”
business rules guide behavior
business rules can be expressed by users
business rules are maintainable
enforcement of business rules can be automated
?
9. Classifications of Business Rules Structural Constraints – static structure
definitions
terms
facts
base
derived
domain constraints – characteristics of data values
relationships
constraints
supertype/subtype
Operational Constraints – ongoing operations
procedural
Declarative
?
10. Operational Constraints “A constraint base is an organized collection of rules (or constraints), usually stored in a repository.”
integrity constraints
triggers
?
11. Assertions “Most business rules are assertions that constrain objects you have already defined on your E-R diagram … entities, attributes, and/or relationships.”
Constrained object
Constraining object
?
12. Types of Constraints Restricted: relation x cannot exist unless relation y exists for these entity instances
Limit: an upper limit exists for the number of relations z that can be set from a given instance of entity a
?