Self Review Questions Constraints based on attribute of superclass Constraints based on value of attribute of superclass

2.3 Self Review Questions

1. Mapping of object-based data model to relational model involves transformation of some features. List the features before transformation and after transformation. 2. List and describe briefly five attributes of object-based data model. 3. What do you understand about object space diagram? How it differs from object-based data model? 4. Explain the concept of inheritance. How many types of inheritance available? Give example for each. 5. What types of objects derived from object classification? 13 3 Introduction Enhanced Entity Relationship Diagram is a conceptual data modeling technique that actually adds some object-oriented concepts in ERD. These additional concepts include subclassessuperclasses, specializationgeneralization, categories and attribute inheritance. It is important for students to understand that EERD includes all modeling concepts of basic ERD but it does not attempt to cover all object concepts. In order to develop EERD it is crucial to know which notations to be adopted. In this practical, Chen notation will be used in all parts. Students will have the opportunity to develop EERD using UML notations in Chapter 4. The objectives of this practical include: To identify the essential objects components added in EERD To define constraints on specialization generalization To Illustrate specialization generalization constraints in both, EERD and UML To develop a complete conceptual design with EERD 14

3.1 Theoretical Background

3.1.1 Constraints and characteristics of specialization and generalization

In fact, more than one specialization can be defined on the same entity type superclass as shown in Figure 3-1. In this case, entities may belong to each of subclass. Nevertheless, a specialization may also involve only a single subclass such {Supervisor} subclass in the figure. No circle notation is required for this type of specialization. Worker Clerk Consultant Physician FirstName MidName LastName Name BirthDate Address WorkCategory ContractStat CertLevel PhysClass d WorkCategory Clerk Consultant Physician IcNum Supervisor Administration Figure 3-1 : Specialization of superclass Worker 15 There are a few types of constraints that determine specialization generalization of entities. These include:

a. Constraints based on attribute of superclass

If all subclasses in a specialization are defined based on the same attribute of superclass, the specialization itself is called attribute-defined specialization. The attribute that involves in the specialization is called defining attribute. In EERD, the defining attribute name is placed next to the line from the circle to the superclass. Figure 3-1 shows an example of a defining attribute called WorkCategory.

b. Constraints based on value of attribute of superclass

In other case, specialization may also be based on the value of some attribute of the superclass. In other words, the entities that will become the member of each superclass are determined by placing a condition on the value of attributes of the superclass. The subclasses generated as the result of this type of specialization is called predicate- defined or conditioned-defined subclasses. The value of attribute which involves in the specialization is called defining predicate. In EERD, the defining predicate name is placed next to the line that connects the subclass to the specialization circle. In Figure 3-1, the values of WorkCategory attribute of superclass Worker are used to determine subclasses. For instance, membership in the CONSULTANT subclass is determined by the predicate WorkCategory = ‘Consultant’. Therefore, all entities in the WORKER entity type whose attribute value for WorkCategory is ‘Consultant’ must belong to subclass CONSULTANT. 16

c. Constraints based on user