Enhanced Entity Relationship (EER) Model: The model resulting from extending the original E-R model with new modeling constructs. Show
The EER model is used to capture important business rules such as constraints in supertype/subtype relationships. Most organization used various rules to guide behavior--but many of these rules cannot be expressed with basic E-R diagrams... Representing Subtypes and SupertypesSubtype: A subgroup of the entities in an entity type that is meaningful to the organization and that shares common attributes or relationships distinct from other subgroupings. Supertype: A generic entity type that has a relationship with one or more subtypes. Attribute Inheritance: A property by which subtype entities inherit values of all attributes of the supertype. [A subtype is an entity type in its own right; an entity instance of a subtype represents the same entity instance of the supertype.] When to Use Supertype/Subtype RelationshipsWe should consider using subtypes when either (or both) of the following conditions are present:
Representing Specialization and GeneralizationGeneralization: The process of defining a more general entity types from a set of more specialized entity types. For example, we could generalize three entity types CAR, TRUCK and MOTORCYCLE as VEHICLE. This is a bottom-up process. Specialization: The process of defining one or more subtypes of the supertype and forming supertype/subtype relationships. Each subtype is formed based on some distinguishing characteristic such as attributes or relationships specific to the subtype. For example, we could specialize the entity type PART into MANUFACTURED PART and PURCHASED PART. This is a top-down process. Specifying Constraints in Supertype/Subtype RelationshipsSpecifying Completeness ConstraintsCompleteness Constraint: A type of constraint that addresses the question whether an instance of a supertype must also be a member of at least one subtype. The completeness constraint has two possible rules: total specialization and partial specialization. Total Specialization Rule: Specifies that each entity instance of the supertype must be a member of some subtype in the relationship. Total specialization is indicated by double lines extending from the supertype to circle from which single lines lead to the subtypes. Partial Specialization Rule: Specifies that an entity instance of the supertype is allowed not to belong to any subtype. Specifying Disjointness ConstraintsDisjointness Constraint: A constraint that addresses the question whether an instance of a supertype may simultaneously be a member of two (or more) subtypes. The disjointness constraint has two possible rules: the disjoint rule and the overlap rule. Disjoint Rule: Specifies that if an entity instance (of a supertype) is a member of one subtype, it cannot simultaneously be a member of any other subtype. Overlap Rule: Specified that an entity instance can simultaneously be a member of two (or more) subtypes. Defining Subtype DiscriminatorsSubtype Discriminator: An attribute of the supertype whose values determine the target subtype or subtypes. For an EMPLOYEE entity type for example, we could use a subtype discriminator (an attribute of EMPLOYEE) called Employee_Type which is coded with one of three values H (for Hourly), S (for Salaried), and C (for consultant). When we have overlapping subtypes, a given instance of the supertype may require that we create an instance in more than one subtype. For instance, if a consider a PART entity th.at can either be manufactured or purchased, the value of the Part_Type attribute would be a composite attribute with manufactured? and purchased?... Defining Supertype/Subtype HierarchiesSupertype/Subtype Hierarchy: A hierarchical arrangement of supertypes and subtypes, where each subtype has only one supertype. Summary of Supertype/Subtype Hierarchies
Entity ClusteringEntity Cluster: A set of one or more entity types and associated relationships grouped into a single abstract entity type. An entity cluster is a useful way to present a data model for a large and complex organization. Because an entity cluster behaves like an entity type, entity clusters and entity types can be further grouped to form a higher-level entity cluster. Entity clustering is a hierarchical decomposition of a macro-level view of the data model into finer and finer views, eventually resulting in the full, detailed data model. Entity clusters could be formed by:
Business Rules RevisitedWe have seen that the participation and disjointness rules constraints associated with supertypes and subtypes are an expression of business rules associated with those relationships. There are however other types of business rules in an organization that cannot be expressed with those notations... We now explore a general framework for business rules ... to express some rules that elude the E-R and EER notations. Classification of Business RulesWe have seen various types of business rules (cardinality values, supertype/subtype relationships, facts about attributes and entity types viz: definitions, ...) There are three main types of business rules: Derivation: A statement derived from other knowledge in the business; commonly a mathematical or logical inference involving literals and facts. Structural Assertion: A statement that expresses some aspect of the static structure of the organization. E-R diagrams are a common way to show structural assertions. A structural assertion is stated as either a term or a fact. Action Assertion: A statement of a constraint or control on the actions of the organization. An action assertion is the property of some business rule and state under what conditions a particular action can be performed on which business rules (e.g. under what conditions a new customer record can be created). Another type of action assertion (called a Domain Constraint) states what values a particular attribute may hold Stating a Structural AssertionA structural assertion says that something of importance to the organization either exists or exists in relationship with other things of interest. A structural assertion can be as simple as the definition of a term, or a fact, which is a statement of a relationship between terms. Derived Fact: A fact that is derived from business rules using an algorithm or inference--in contrast to base facts, which are fundamental and cannot be derived from other terms or facts. Stating an Action AssertionWhereas a structural assertion deals with the static structure of an organization, an action assertion deals with the dynamic aspects of the organization. Action assertion impose constraints on handling data. An action assertion is the property of some business rule (called the anchor object). For a data handling action (e.g. create, update, delete, or read) it states how other business rules (called the corresponding objects) act on the anchor object. Anchor Object: A business rule (a fact) on which actions are limited. Action: An operation, such as create, update, delete, or read, which may be performed on data objects. Corresponding Object: A business rule (fact) that influences the ability to perform an action on another business rule. Examples:
Types of Action AssertionsThere are three ways to classify action assertions: Action assertions can be classified based on the type of result from the assertion
Action assertions can be classified based on the form of the assertion
Action assertions can be classified based on the rigor of the assertion
Representing and Enforcing Business RulesAction assertions have traditionally been implemented in procedural logic buried deep within individual application programs--in a form that is virtually unrecognizable, unmanageable, and inconsistent. This approach, evidently, places a heavy burden on the programmer. The more modern approach is to declare action assertions at a conceptual level without specifying how the rule will be implemented. Hence, there needs to be a specification language for business rules as the E-R and ERR models are limited in their ability to represent complex business rules. An alternative with be a structured grammar model--but whichever the approach chose, two desirable features for a business rule specification language would be:
Enter SQL. Identifying and Testing Business RulesThe task of the database analyst is to identify business rules, document the specifications of those rules, develop strategies for enforcing those rules as much as through database technologies, and then testing them before implementing them in technology. An approach to identifying and testing business rules is scenarios. A scenario is a story or script that describes how a business reacts to a given situation, and is similar to the concept of a use case, which is an important tool in object modeling. If a set of business rules have not already been identified, a scenario could be used to identify terms, facts, and action assertions to be included in the data model. If a set of business rules already exist, then statements in scenarios can be used to validate that the business rules handle all possible circumstances. What rule specifies that an entity instance of a supertype can be a member of more than one subtype at a time?The overlap rule specifies that if an entity instance of the supertype is a member of one subtype, it can simultaneously be a member of two (or more) subtypes.
Which of the following specifies that each entity instance of the super type must be a member of some sub type in the relationship?Total specialization specifies that each entity instance of the supertype must be a member of some subtype in the relationship. Partial specialization specifies that an entity instance of the supertype does not have to belong to any subtype, and may or may not be an instance of one of the subtypes.
What type of constraints in Supertype that an instance of a supertype must also be a member of at least one subtype?Completeness Constraints: Whether an instance of a supertype must also be a p yp member of at least one subtype.
Is a generic entity type that has a relationship with one or more subtypes?A supertype is a generic entity type that has a relationship with one or more subtypes. A subtype is a sub-grouping of the entities in an entity type that is meaningful to the organization and that shares common attributes or relationships distinct from other subgroups.
|