๐ฏ Chapter 4: Enhanced EโR (EER) Modeling
- 4.1 EER stands for Enhanced ER or Extended ER.
- 4.2 EER Model Concepts โ includes all basic ER concepts plus additional ones.
- 4.3 EER is used to model applications more completely and accurately; includes objectโoriented concepts like inheritance.
- 4.4 Knowledge Representation and Ontology Concepts.
EER ูู ุงู ุชุฏุงุฏ ูู ER ูุชุถูู ู ูุงููู ู ุซู: ุงููุงุฆูุงุช ุงููุงุฆูุฉ/ุงููุฑุนูุฉุ ุงูุชุฎุตุต/ุงูุชุนู ูู ุ ุงููุฆุงุช (Union)ุ ูุฑุงุซุฉ ุงูุณู ุงุช ูุงูุนูุงูุงุชุ ูุงููููุฏ.
๐งฉ EER Additional Concepts
Includes all modeling concepts of basic ER plus:
- Subclasses / Superclasses
- Specialization / Generalization
- Categories (UNION types)
- Attribute and relationship inheritance
Also includes constraints on specialization/generalization.
ูู ุงููุตูู ุงูุณุงุจูุฉ ุชุนูู ูุง ูู ูุฐุฌ ER ุงูุฐู ูุนุชู ุฏ ุนูู ููุงูุงุช ูุนูุงูุงุช ุจุณูุทุฉ. ููู ุนูุฏ ุชุตู ูู ููุงุนุฏ ุจูุงูุงุช ุญููููุฉุ ูุฌุฏ ุฃู ุงูุนุงูู ุงููุงูุนู ูุญุชูู ุนูู ุชูุงุตูู ุฃูุซุฑ ุชุนููุฏุงู. ุนูู ุณุจูู ุงูู ุซุงู: ุงูู ูุธููู ููุณูุง ูููู ู ุชุดุงุจูููุ ูููุงู ู ููุฏุณูู ูุณูุฑุชุงุฑูุฉ ูู ุฏุฑุงุกุ ูููู ู ุฌู ูุนุฉ ุฎุตุงุฆุต ุฅุถุงููุฉ. ููุง ูุฃุชู ุฏูุฑ ูู ูุฐุฌ EER (ุงููู ุฐุฌุฉ ุงูู ูุณุนุฉ ููููุงูุงุช ูุงูุนูุงูุงุช) ุงูุฐู ูุถูู ู ูุงููู ูููุฉ ู ุซู:
- Subclasses/Superclasses (ุงููุงุฆูุงุช ุงููุฑุนูุฉ ูุงููุงุฆูุฉ) โ ูุชู ุซูู ุงูุชุตูููุงุช ุงูู ุฎุชููุฉ.
- Specialization/Generalization (ุงูุชุฎุตุต ูุงูุชุนู ูู ) โ ุทุฑู ุจูุงุก ูุฐู ุงูุชุตูููุงุช.
- Categories (UNION types) (ุงููุฆุงุช) โ ุนูุฏู ุง ูู ูู ุฃู ูููู ุงููุงุฆู ู ู ุนุฏุฉ ุฃููุงุน ู ุฎุชููุฉ.
- Inheritance (ุงููุฑุงุซุฉ) โ ุญูุซ ุชุฑุซ ุงููุงุฆูุงุช ุงููุฑุนูุฉ ุตูุงุช ุงููุงุฆูุงุช ุงููุงุฆูุฉ.
- Constraints (ุงููููุฏ) โ ูููุฏ ุนูู ููููุฉ ุชูุฒูุน ุงููุงุฆูุงุช ุจูู ุงูุชุตูููุงุช.
ูุฐู ุงูู ูุงููู ุชุฌุนู ุงููู ูุฐุฌ ุฃูุซุฑ ุฏูุฉ ููุฏุฑุฉ ุนูู ุชู ุซูู ุงููุงูุนุ ููู ุชุดุจู ู ูุงููู ุงูุจุฑู ุฌุฉ ุงููุงุฆููุฉ (OOP) ู ุซู ุงููุฑุงุซุฉ.
๐น Subclasses and Superclasses
An entity type may have additional meaningful subgroupings of its entities โ these are called subclasses (or subtypes).
Example: EMPLOYEE can be grouped into: SECRETARY, ENGINEER, TECHNICIAN (based on job), MANAGER (role), SALARIED_EMPLOYEE, HOURLY_EMPLOYEE (based on pay method).
Each subclass is a subset of the superclass EMPLOYEE. EMPLOYEE is the superclass for each.
๐ ISโA Relationships
These are called ISโA relationships: SECRETARY ISโA EMPLOYEE, TECHNICIAN ISโA EMPLOYEE, etc.
Important: An entity that is a member of a subclass represents the same real-world entity as some member of the superclass. The subclass member is the same entity in a distinct specific role.
An entity cannot exist in the database merely by being a member of a subclass; it must also be a member of the superclass. A member of the superclass can optionally be included in any number of its subclasses.
- A salaried employee who is also an engineer belongs to two subclasses: ENGINEER and SALARIED_EMPLOYEE.
- A salaried employee who is also an engineering manager belongs to three subclasses: MANAGER, ENGINEER, SALARIED_EMPLOYEE.
Figure 4.1 โ EER notation for subclasses and specialization
ุงููุฏู: ุชู ุซูู ุฃู ุงูููุงูุงุช ูู ุงููุงูุน ููุณุช ูููุง ู ุชุดุงุจูุฉุ ุจู ููุง ุชุตูููุงุช ูุฑุนูุฉ.
Superclass (ูุงุฆู ูุงุฆู) ูู ููุงู ุนุงู ุ ู ุซู EMPLOYEE. Subclass (ูุงุฆู ูุฑุนู) ูู ู ุฌู ูุนุฉ ุฌุฒุฆูุฉ ู ู ูุฐุง ุงูููุงูุ ู ุซู ENGINEER. ุงูุนูุงูุฉ ุจูููู ุง ุชุณู ู ISโA (ูู ููุน ู ู).
ููุงุนุฏ ู ูู ุฉ:
- ุงููุงุฆู ูู subclass ูู ููุณ ุงูููุงู ูู superclassุ ููู ุจุฏูุฑ ู ุญุฏุฏ. ู ุซูุงู: ุฃุญู ุฏ ูู ู ูุธูุ ููู ุฃูุถุงู ู ููุฏุณ. ูุง ููุฌุฏ ุดุฎุตุงู ู ููุตูุงู.
- ูุง ูู ูู ุฃู ูููู ููุงู ูุงุฆู ูู subclass ุฏูู ุฃู ูููู ู ูุฌูุฏุงู ูู superclass. (ูุง ูู ูู ุฃู ูููู ููุงู ู ููุฏุณ ุฏูู ุฃู ูููู ู ูุธูุงู).
- ุงููุงุฆู ูู superclass ูู ูู ุฃู ููุชู ู ุฅูู ุนุฏุฉ subclasses. ู ุซูุงู: ู ูุธู ูู ูู ุฃู ูููู ู ููุฏุณุงู ูู ุฏูุฑุงู ูู ููุณ ุงูููุช.
ู ุซุงู ู ู ุงูุญูุงุฉ: ูู ุฌุงู ุนุฉุ ูุฏููุง ููุงู PERSON. ูู ูู ุฃู ูููู ูู subclasses: STUDENT, PROFESSOR, STAFF. ูู ุดุฎุต ูู ุฃุญุฏ ูุฐู ุงูุฃุฏูุงุฑ (ุฃู ุฃูุซุฑ). ุงูุตูุงุช ุงูู ุดุชุฑูุฉ (ุงูุงุณู ุ ุงูุนููุงู) ู ูุฌูุฏุฉ ูู PERSONุ ูุงูุตูุงุช ุงูุฎุงุตุฉ (ู ุซู ุงูุชุฎุตุต ููุทุงูุจ) ุชุถุงู ูู subclass.
๐งฌ Inheritance
An entity that is a member of a subclass inherits:
- All attributes of the entity as a member of the superclass.
- All relationships of the entity as a member of the superclass.
Example: SECRETARY, TECHNICIAN, ENGINEER inherit attributes Name, SSN, โฆ, from EMPLOYEE. Every SECRETARY entity will have values for those inherited attributes.
Subclasses can also have specific (local) attributes (e.g., TypingSpeed for SECRETARY) and participate in specific relationship types (e.g., BELONGS_TO for HOURLY_EMPLOYEE).
ุงููุฑุงุซุฉ ูู ู ูุฒุฉ ูููุฉ ูู EER. ุจุจุณุงุทุฉุ ุงููุงุฆู ูู subclass ูุฑุซ ูู ุงูุตูุงุช ูุงูุนูุงูุงุช ุงูู ูุฌูุฏุฉ ูู superclass. ูุฐุง ูุนูู ุฃููุง ูุง ูุญุชุงุฌ ุฅูู ุฅุนุงุฏุฉ ุชุนุฑูู ุงูุงุณู ูุงูุฑูู ุงูููู ู ... ููู ู ููุฏุณ. ูู ู ูุฌูุฏุฉ ุชููุงุฆูุงู.
ู ุซุงู: ูู SECRETARY ูู ุงุณู (Name) ูุฑูู ุถู ุงู ุงุฌุชู ุงุนู (SSN) ู ู EMPLOYEE. ุจุงูุฅุถุงูุฉ ุฅูู ุฐููุ ูู ูู ููุณูุฑุชูุฑ ุฃู ูููู ูู ุณู ุฉ ู ุญููุฉ ู ุซู TypingSpeed (ุณุฑุนุฉ ุงูุทุจุงุนุฉ) ูุง ุชูุฌุฏ ุนูุฏ ุงูู ูุธููู ุงูุขุฎุฑูู.
ูุฐููุ ุงูุนูุงูุงุช (ู ุซู Works_For) ุงูุชู ูุดุงุฑู ูููุง ุงูู ูุธู ุชููู ู ูุฑูุซุฉ ููุณูุฑุชูุฑ. ูู ูู ุฃู ูููู ููุณูุฑุชูุฑ ุฃูุถุงู ุนูุงูุงุช ุฎุงุตุฉ ุจู.
ุชุดุจูู: ุงููุฑุงุซุฉ ู ุซู ุงูู ูุฑุงุซ ูู ุงูุนุงุฆูุฉ: ุงูุฃุจ (superclass) ูู ู ู ุชููุงุช (ุตูุงุช)ุ ูุงูุฃุจูุงุก (subclasses) ูุฑุซูู ูุฐู ุงูู ู ุชููุงุชุ ููู ูู ุฃู ูุถูููุง ู ู ุชููุงุช ุฎุงุตุฉ ุจูู .
โฌ๏ธ Specialization (topโdown)
Specialization is the process of defining a set of subclasses of a superclass based on some distinguishing characteristics.
Examples:
- {SECRETARY, ENGINEER, TECHNICIAN} based on job type.
- MANAGER based on role.
- {SALARIED_EMPLOYEE, HOURLY_EMPLOYEE} based on method of pay.
We can have several specializations of the same superclass.
ุงูุชุฎุตุต ูู ุนู ููุฉ ู ู ุงูุฃุนูู ุฅูู ุงูุฃุณูู (top-down). ูุจุฏุฃ ุจููุงู ุนุงู (superclass) ุซู ููุณู ู ุฅูู ูุงุฆูุงุช ูุฑุนูุฉ (subclasses) ุจูุงุกู ุนูู ุตูุงุช ู ู ูุฒุฉ.
ู ุซุงู: ูุฏููุง EMPLOYEE. ููุงุญุธ ุฃู ุงูู ูุธููู ูุฎุชูููู ูู ูุธุงุฆููู . ูุฐูู ูุตูุน ุชุฎุตุตุงู ูุณู ู Job_Specialization ูุชุถู ู {ENGINEER, SECRETARY, TECHNICIAN}. ููุตูุน ุชุฎุตุตุงู ุขุฎุฑ ูุณู ู Pay_Specialization ูุชุถู ู {SALARIED_EMPLOYEE, HOURLY_EMPLOYEE}.
ูู ุงุฐุง ูุณุชุฎุฏู ุงูุชุฎุตุตุ ูุฃู ูู ู ุฌู ูุนุฉ ูุฑุนูุฉ ูุฏ ุชุญุชุงุฌ ุฅูู ุตูุงุช ุฅุถุงููุฉ ูุง ุชูุทุจู ุนูู ุจุงูู ุงูู ูุธููู. ู ุซูุงู: ุงูู ููุฏุณ ูุฏ ูููู ูู ุชุฎุตุต (Civil, Software) ูุง ูุญุชุงุฌู ููุณูุฑุชูุฑ.
โฌ๏ธ Generalization (bottomโup)
Generalization is the reverse of specialization. Several classes with common features are generalized into a superclass; original classes become its subclasses.
Example: CAR and TRUCK are generalized into VEHICLE. Both become subclasses of VEHICLE.
Figure 4.3 โ Generalization
In practice, a combination of both processes is usually employed.
ุงูุชุนู ูู ูู ุนูุณ ุงูุชุฎุตุต. ูุจุฏุฃ ู ู ุงูุฃุณูู ุฅูู ุงูุฃุนูู (bottom-up). ูุฏููุง ุนุฏุฉ ููุงูุงุช ูุฑุนูุฉุ ููุงุญุธ ุฃููุง ุชุดุชุฑู ูู ุตูุงุช ู ุนููุฉุ ููููู ุจุฅูุดุงุก ููุงู ูุงุฆู (superclass) ูุฌู ุน ูุฐู ุงูุตูุงุช ุงูู ุดุชุฑูุฉ.
ู ุซุงู: ูุฏููุง CAR ู TRUCK. ููุงูู ุง ูู ุฑูู ุชุนุฑูู (Vehicle_id) ูุทุฑุงุฒ (Model). ูู ูููุง ุฅูุดุงุก VEHICLE ูู superclass ูุญุชูู ุนูู ูุฐู ุงูุตูุงุช ุงูู ุดุชุฑูุฉุ ูุชุตุจุญ CAR ู TRUCK ูุงุฆูุงุช ูุฑุนูุฉ (subclasses).
ูู ุงูุชุทุจููุงุช ุงูุนู ููุฉ: ุบุงูุจุงู ู ุง ูุณุชุฎุฏู ุฎููุทุงู ู ู ุงูุชุฎุตุต ูุงูุชุนู ูู . ูุจุฏุฃ ุจุชุญุฏูุฏ ุงูููุงูุงุช ุงูุฑุฆูุณูุฉ ุซู ูููุญ ุงููู ูุฐุฌ ุจุฅุถุงูุฉ ุงูุชุฎุตุตุงุช ุฃู ุงูุชุนู ูู ุงุช ุญุณุจ ุงูุญุงุฌุฉ.
๐ท๏ธ Types of Specialization
- Predicate-defined (condition-defined): based on a condition (e.g., Job-type = 'Engineer').
- Attribute-defined: a special case where condition is on the same attribute (defining attribute). Example: JobType is defining attribute for {SECRETARY, TECHNICIAN, ENGINEER}.
- User-defined: membership is defined by the user on an entityโbyโentity basis.
Figure 4.4 โ Attribute-defined specialization on Job_type
ููู ูุญุฏุฏ ู ู ููุชู ู ุฅูู ุฃู subclassุ ููุงู ุซูุงุซ ุทุฑู:
- Predicate-defined (ู ุญุฏุฏ ุจุดุฑุท): ูุถุน ุดุฑุทุงู ุนูู ููู ุฉ ุณู ุฉ. ู ุซูุงู: ุฅุฐุง ูุงูุช ููู ุฉ ุงูุณู ุฉ Job_type ุชุณุงูู "Engineer" ูุฅู ุงูู ูุธู ููุชู ู ุฅูู subclass ENGINEER.
- Attribute-defined (ู ุญุฏุฏ ุจุณู ุฉ): ูุฐุง ููุน ุฎุงุต ู ู ุงูุชุฎุตุต ุนูุฏู ุง ูููู ุงูุดุฑุท ู ุนุชู ุฏุงู ุนูู ููุณ ุงูุณู ุฉ ููู ุงูู subclasses. ุงูุณู ุฉ ุชุณู ู defining attribute. ู ุซุงู: ุณู ุฉ JobType ุชุญุฏุฏ ุงูุนุถููุฉ ูู {SECRETARY, TECHNICIAN, ENGINEER}. ูู ุงูุฑุณู ุ ููุชุจ ุงุณู ุงูุณู ุฉ ุจุฌุงูุจ ุงูุฎุท.
- User-defined (ู ุญุฏุฏ ู ู ุงูู ุณุชุฎุฏู ): ูุง ููุฌุฏ ุดุฑุท ุขูู. ุงูู ุณุชุฎุฏู (ุฃู ุงูู ุจุฑู ุฌ) ูู ู ู ููุฑุฑ ูุฏููุงู ุฃู ูุงุฆู ููุชู ู ูุฃู subclass. ูุฐุง ู ูุงุณุจ ุนูุฏู ุง ูุง ูู ูู ุงูุชุนุจูุฑ ุนู ุงูุนุถููุฉ ุจุดุฑุท ุจุณูุท.
โ ๏ธ Two Basic Constraints
1. Disjointness Constraint
- Disjoint (d): an entity can be a member of at most one subclass of the specialization. (Example: EMPLOYEE cannot be both SALARIED and HOURLY.)
- Overlapping (o): an entity may be a member of more than one subclass. (Example: a person can be both STUDENT and EMPLOYEE.)
2. Completeness (Exhaustiveness) Constraint
- Total (double line): every entity in the superclass must be a member of some subclass.
- Partial (single line): an entity may not belong to any subclass.
๐ Four Combinations
| Disjoint, Total | Every entity belongs to exactly one subclass, no overlap. (Example: Employee โ Hourly/Salaried, must be one) |
| Disjoint, Partial | An entity can be in at most one subclass, but some may be in none. (Example: Vehicle โ Car/Motorcycle, but some vehicles are neither) |
| Overlapping, Total | Every entity belongs to at least one subclass, may belong to several. (Example: Person โ Student/Employee, every person must be at least one) |
| Overlapping, Partial | Entities may belong to one or more subclasses, or none. (Example: BankAccount โ Savings/Checking, a customer may have both, one, or a basic account) |
Figure 4.4 (disjoint partial) and Figure 4.5 (overlapping total)
ุนูุฏ ุชุตู ูู ุงูุชุฎุตุตุ ูุญุชุงุฌ ุฅูู ุชุญุฏูุฏ ููุฏูู ุฑุฆูุณููู:
ุฃููุงู: ููุฏ ุงูุชุจุงูู (Disjointness) โ ููุฑู ุฒ ูู ุจู d ุฃู o
- Disjoint (d): ุงููุงุฆู ูู ูู ุฃู ูููู ุนุถูุงู ูู subclass ูุงุญุฏ ููุท. ู ุซุงู: ู ูุธู ูุง ูู ูู ุฃู ูููู ูู ููุณ ุงูููุช ู ูุธูุงู ุจุฑุงุชุจ ุดูุฑู ูู ูุธูุงู ุจุงูุณุงุนุฉ. ูุฐุงู ุงูููุนุงู ู ุชูุงููุงู.
- Overlapping (o): ุงููุงุฆู ูู ูู ุฃู ูููู ุนุถูุงู ูู ุนุฏุฉ subclasses. ู ุซุงู: ุดุฎุต ูู ูู ุฃู ูููู ุทุงูุจุงู ูู ูุธูุงู ูู ููุณ ุงูููุช. ุงูุฃุฏูุงุฑ ุบูุฑ ู ุชูุงููุฉ.
ุซุงููุงู: ููุฏ ุงูุงูุชู ุงู (Completeness) โ ููุฑู ุฒ ูู ุจููุน ุงูุฎุท
- Total (ุฎุท ู ุฒุฏูุฌ): ูู ูุงุฆู ูู superclass ูุฌุจ ุฃู ููุชู ู ุฅูู subclass ูุงุญุฏ ุนูู ุงูุฃูู. ู ุซุงู: ูู ู ูุธู ุฅู ุง ุจุฑุงุชุจ ุดูุฑู ุฃู ุจุงูุณุงุนุฉ. ูุง ููุฌุฏ ู ูุธู ุฎุงุฑุฌ ูุฐูู ุงูููุนูู.
- Partial (ุฎุท ู ูุฑุฏ): ูู ูู ุฃู ูููู ููุงู ูุงุฆูุงุช ูู superclass ูุง ุชูุชู ู ุฅูู ุฃู subclass. ู ุซุงู: ู ุฑูุจุฉ ูู ูู ุฃู ุชููู ุณูุงุฑุฉ ุฃู ุฏุฑุงุฌุฉุ ููู ูุฏ ุชููู ููุงู ู ุฑูุจุงุช ุฃุฎุฑู (ุดุงุญูุฉ) ููุณุช ู ุตููุฉ.
ู ู ูุฐูู ุงูููุฏููุ ูุญุตู ุนูู ุฃุฑุจุน ุญุงูุงุช (ุฃูุธุฑ ุงูุฌุฏูู). ููู ูุฐู ุงูุญุงูุงุช ูุณุงุนุฏ ูู ุชุตู ูู ูุงุนุฏุฉ ุจูุงูุงุช ุฏูููุฉ.
๐ฒ Hierarchies and Lattices
- Hierarchy: every subclass has only one superclass (single inheritance) โ a tree structure.
- Lattice: a subclass can have more than one superclass (multiple inheritance) โ called a shared subclass.
Example: ENGINEERING_MANAGER is a subclass of both ENGINEER and MANAGER (shared subclass).
Figure 4.6 โ Specialization lattice with shared subclass ENGINEERING_MANAGER
Inheritance in lattice: a subclass inherits attributes of all its direct and predecessor superclasses.
Figure 4.7 โ Specialization lattice for UNIVERSITY database
ุนูุฏู ุง ูุจุฏุฃ ูู ุจูุงุก ุชุฎุตุตุงุช ู ุชุนุฏุฏุฉุ ูุฏ ุชุชุดูู ูุฏููุง ููุงูู:
- Hierarchy (ุชุฏุฑุฌ): ูู subclass ูู superclass ูุงุญุฏ ููุท. ูุฐุง ูุดุจู ุงููุฑุงุซุฉ ุงููุญูุฏุฉ (single inheritance). ู ุซุงู: EMPLOYEE โ ENGINEER โ SOFTWARE_ENGINEER. ูุง ููุฌุฏ ุณูู ู ุณุงุฑ ูุงุญุฏ ูููุฑุงุซุฉ.
- Lattice (ุดุจูุฉ): ูู ูู ุฃู ูููู ููู subclass ุฃูุซุฑ ู ู superclass ูุงุญุฏ. ูุฐุง ูุณู ู ุงููุฑุงุซุฉ ุงูู ุชุนุฏุฏุฉ (multiple inheritance) ูุงูู subclass ูุณู ู shared subclass. ู ุซุงู: ENGINEERING_MANAGER ูู ู ููุฏุณ (ENGINEER) ูู ุฏูุฑ (MANAGER) ูู ููุณ ุงูููุช. ูุฐูู ูุฑุซ ุตูุงุช ุงูู ููุฏุณ ูุตูุงุช ุงูู ุฏูุฑ ู ุนุงู.
ู ูุงุญุธุฉ ู ูู ุฉ: ูู ุงูุดุจูุฉุ ุงูู subclass ูุฑุซ ุตูุงุช ุฌู ูุน ุงูู superclasses ุงูู ุจุงุดุฑุฉ ูุบูุฑ ุงูู ุจุงุดุฑุฉ. ูุฐุง ูููุฑ ููุฉ ุชุนุจูุฑูุฉ ูุจูุฑุฉ ูููู ูุถูู ุชุนููุฏุงู.
๐ท Categories (Union Types)
In some cases, we need a single superclass/subclass relationship with more than one superclass โ a category or UNION type.
Example: In a vehicle registration database, an owner can be a PERSON, a BANK, or a COMPANY. We create a category OWNER that is a subset of the union of these three entity types.
A category member must exist in at least one of its superclasses (typically just one).
Difference from shared subclass:
- Shared subclass: subset of the intersection of its superclasses (must exist in all superclasses).
- Category: subset of the union (exists in at least one).
Figure 4.8 โ Two categories: OWNER and REGISTERED_VEHICLE
ู ุดููุฉ ุฌุฏูุฏุฉ: ุฃุญูุงูุงู ูุญุชุงุฌ ุฅูู ุชู ุซูู ูุงุฆู ูู ูู ุฃู ูููู ู ู ุนุฏุฉ ุฃููุงุน ู ุฎุชููุฉ ุชู ุงู ุงู. ู ุซุงู: ู ู ูู ููู ุงู ุชูุงู ุณูุงุฑุฉุ ูู ูู ุฃู ูููู ุดุฎุตุงู (PERSON)ุ ุฃู ุจููุงู (BANK) ูู ุญู ุงูุญุฌุฒ (lien)ุ ุฃู ุดุฑูุฉ (COMPANY).
ุงูุญู: ููุดุฆ category (ูุฆุฉ) ุงุณู ูุง OWNER. ูุฐู ุงููุฆุฉ ูู ุงุชุญุงุฏ (union) ููููุงูุงุช ุงูุซูุงุซุฉ. ุฃู ุฃู ุงูุนุถู ูู OWNER ูุฌุจ ุฃู ูููู ู ูุฌูุฏุงู ูู ูุงุญุฏ ุนูู ุงูุฃูู ู ู ูุฐู ุงูููุงูุงุช (ูููุณ ุจุงูุถุฑูุฑุฉ ูููุง).
ุงููุฑู ุจูู category ู shared subclass:
- Shared subclass (ู ุซู ENGINEERING_MANAGER) ูุดุชุฑุท ุฃู ูููู ุงููุงุฆู ู ูุฌูุฏุงู ูู ุฌู ูุน ุงูู superclasses (ุชูุงุทุน โ intersection).
- Category (ู ุซู OWNER) ูุดุชุฑุท ุฃู ูููู ุงููุงุฆู ู ูุฌูุฏุงู ูู ูุงุญุฏ ุนูู ุงูุฃูู ู ู ุงูู superclasses (ุงุชุญุงุฏ โ union).
ูู ุงูู ุฎุทุทุงุชุ ูุฑู ุฒ ูููุฆุฉ ุจุฏุงุฆุฑุฉ ุฏุงุฎููุง ุญุฑู U (Union).
๐ Formal Definitions
- Class C: a type of entity with a corresponding set of entities (could be entity type, subclass, superclass, or category).
- Subclass S of C: S inherits all attributes and relationships of C; the set of entities of S is always a subset of the set of entities of C.
- Specialization Z = {Sโ, Sโ, ..., Sโ} with superclass G. Z is total if union of all Sแตข = G; otherwise partial. Z is disjoint if Sแตข โฉ Sโฑผ = โ for iโ j; otherwise overlapping.
- Predicate-defined subclass: S = G[p], where p is a condition on attributes of G.
- Attribute-defined specialization: if a predicate A = cแตข is used for each subclass (A is the defining attribute).
- Category (UNION type) T: T โ (Dโ โช Dโ โช ... โช Dโ) where Dแตข are defining superclasses. T is a subset of the union.
ููุฏูุฉุ ูุนุฑู ูุฐู ุงูู ูุงููู ุฑูุงุถูุงู:
- Class: ุฃู ููุน ููุงู (entity type, subclass, superclass, category).
- Subclass S ู ู C: S ู ุฌู ูุนุฉ ุฌุฒุฆูุฉ ู ู Cุ ูุชุฑุซ ูู ุตูุงุช ูุนูุงูุงุช C.
- Specialization Z = {Sโ, Sโ, ..., Sโ} ู ุน superclass G. Z ูู total ุฅุฐุง ูุงู ุงุชุญุงุฏ Sแตข = G (ุฃู ุฃู ูู ูุงุฆู ูู G ููุชู ู ูู subclass). Z ูู partial ุฅุฐุง ูุงู ุงูุงุชุญุงุฏ ู ุฌู ูุนุฉ ุฌุฒุฆูุฉ ู ู G. Z ูู disjoint ุฅุฐุง ูุงูุช ุงูู ุฌู ูุนุงุช ู ููุตูุฉ (ูุง ููุฌุฏ ุนูุตุฑ ู ุดุชุฑู).
- Predicate-defined subclass: S = G[p] ุญูุซ p ุดุฑุท ุนูู ุณู ุงุช G. ู ุซุงู: ENGINEER = EMPLOYEE[Job_type = 'Engineer'].
- Attribute-defined specialization: ุฅุฐุง ูุงู ุงูุดุฑุท ููู subclass ูู ููู ุฉ ู ุญุฏุฏุฉ ูููุณ ุงูุณู ุฉ. ู ุซุงู: ููู subclass ุดุฑุท ุนูู ุณู ุฉ Job_type.
- Category T: T โ (Dโ โช Dโ โช ... โช Dโ). ุฃู ุฃู ูู ุนูุตุฑ ูู T ูู ุนูุตุฑ ูู ูุงุญุฏ ุนูู ุงูุฃูู ู ู ุงูู superclasses.
๐ UML and Other Notations
EER diagrams use specific notation, but many design tools use alternatives like UML class diagrams.
Figure 4.10 โ UML class diagram for specialization/generalization
Other notations exist for displaying attributes, cardinality ratios, (min, max) constraints, etc.
Figure A.1 โ Alternative notations
ููุงู ุฑู ูุฒ ุจุฏููุฉ ูุชู ุซูู EER ู ุซู UML class diagrams ูุฑู ูุฒ ุฃุฎุฑู ููุณู ุงุช ูุงูุนูุงูุงุช ูุงููููุฏ.
๐ Chapter 4 โ EER Modeling: All Key Concepts
- EER extends ER with: subclasses/superclasses, specialization/generalization, categories (UNION), inheritance, and constraints.
- Subclass ISโA superclass; inherits attributes/relationships; can have local attributes.
- Specialization (topโdown): defining subclasses from a superclass. Generalization (bottomโup): combining classes into a superclass.
- Types of specialization: predicate-defined, attribute-defined, user-defined.
- Constraints: disjoint (d) vs overlapping (o); total (double line) vs partial (single line). Four combinations.
- Hierarchy: single inheritance; Lattice: multiple inheritance (shared subclass).
- Category (UNION type): subclass of more than one superclass (member in at least one).
- Formal definitions: class, subclass, specialization, category.
- Alternative notations: UML, various (min, max) notations.
- EER ูู ุงู ุชุฏุงุฏ ูู ER ูุณู ุญ ุจุชู ุซูู ุฃูุซุฑ ุฏูุฉ ูููุงูุน.
- Subclasses (ูุงุฆูุงุช ูุฑุนูุฉ) ุชู ุซู ุชุตูููุงุช ุฏุงุฎู ุงููุงุฆู ุงููุงุฆู (superclass). ุงูุนูุงูุฉ ูู ISโA.
- Specialization (ุชุฎุตุต) ูู ุนู ููุฉ ุชูุณูู superclass ุฅูู subclasses. Generalization (ุชุนู ูู ) ูู ุนูุณูุง.
- ุงูู subclass ูุฑุซ (inherits) ูู ุตูุงุช ูุนูุงูุงุช ุงูู superclassุ ููู ูู ุฃู ูุถูู ุตูุงุช ู ุญููุฉ.
- ููุงู ุฃููุงุน ู ู ุงูุชุฎุตุต: ู ุญุฏุฏ ุจุดุฑุทุ ู ุญุฏุฏ ุจุณู ุฉุ ู ุญุฏุฏ ู ู ุงูู ุณุชุฎุฏู .
- ุงููููุฏ: disjoint (d) ู overlapping (o) (ูุชุญุฏูุฏ ุฅู ูุงููุฉ ุงูุงูุชู ุงุก ูุนุฏุฉ subclasses)ุ ู total/partial (ุฎุท ู ุฒุฏูุฌ/ู ูุฑุฏ) ูุชุญุฏูุฏ ู ุง ุฅุฐุง ูุงู ูู ูุงุฆู ูู superclass ูุฌุจ ุฃู ููุชู ู ูู subclass.
- Hierarchy: ูุฑุงุซุฉ ูุญูุฏุฉ. Lattice: ูุฑุงุซุฉ ู ุชุนุฏุฏุฉ (shared subclass).
- Category (Union type): ูุฆุฉ ุชู ุซู ุงุชุญุงุฏ ุนุฏุฉ superclasses ู ุฎุชููุฉ (ุงูุนุถู ูู ูุงุญุฏ ู ููุง ุนูู ุงูุฃูู).