Computer Science/Database

2. Enhanced Entity-Relationship (EER) model

  • -
728x90
반응형

Subclasses and Superclasses Specialization

May have several specializations of the same superclass

💡
subclass notation : \subset
💡
OOP에서 Inheritance 개념과 유사하게 이해할 수 있다. subclass가 추가적인 attribute를 가지는 것이다.
💡
만약 superclass가 특정 entity와 relationship을 가지고 있다면 subclass 또한 해당 entity와 relationship을 가지고 있음을 내재하고 있다 : OOP 개념으로 이해하면 자명하다.
💡
specialization은 결과적으로 subclass만이 가지는 일종의 member variable로 이해할 수 있다. 즉 이를 통해 모든 class가 아니라 subclass에만 속하는 것이다.

Generalization

Reverse of specialization. Several classes with common features generalize into a superclass

💡
만약에 겹치는 것이 있다면 superclass를 설정해서 generalize하겠다는 것이다.

Disjointness Constraint

  • Disjoint : 최대 1개의 subclass에만 속할 수 있는 것
  • Overlapping : 여러 subclass에 속할 수 있는 것
💡
원 안의 character로 표기한다.

Completeness Constraint

Total : 반드시 어떤 subclass에 속해야한다는 것

Partial : subclass에 속하지 않는 entity가 있을 수 있는 것이다.

→ 예를 들어, 아직 categorized되지 않은 것이 있다면 partial이라는 것이다.

💡
줄 2개 표기 여부로 구분한다.

Summary of Constraints on Specialization and Generalization

There are four types of specialization/generalization

  1. Disjoint, total
  1. Disjoint, partial
  1. Overlapping, total
  1. Overlapping, partial

Subset without Specialization

There are no additional attributes in MANAGER entity. It is called a subset without specification.

Attribute-defined Specialization

Categories (UNION Types)

All of the superclass/subclass relationships we have seen so far have a single superclass

However, a shared subclass is a subclass in

  1. more than one distinct superclass/subclass relationships
  1. each relationship has a single superclass
  1. shared subclass leads to multiple inheritances

Therefore, we need to model a single superclass/subclass relationship with more than one superclass. Superclasses can represent different entity types. Such a subclass is called a category or UNION Type

Example

In a database for vehicle registration, a vehicle owner can be a PERSON, a BANK, or a COMPANY. A category called OWNER is created to represent a subset of the union of the three superclasses COMPANY, BANK, and PERSON. A category member must exist in at least one of its superclasses

💡
shared subclasss와 다른 점은 shared subclass의 경우에는 모든 superclass에 존재해야한다는 점에서 차이가 있다.

Putting it together

반응형
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.