CS/데이터베이스

[DB]Ch4. The Enhanced Entity-Relationship(EER) Model

공백._. 2021. 10. 18. 20:36

Part 2. Conceptual Data Modeling and Database Design

Book_Chapter 4 The Enhanced Entity-Relationship(EER) Model

  1. Subclasses, Superclasses, and Inheritance
  2. Specialization and Generalization
  3. Constraints and Characteristics of Specialization and Generalization Hierarchies
  4. Modeling of UNION Types Using Categories
  5. A Sample UNIVERSITY EER Schema, Design Choices, and Formal Definitions
  6. Example of Other Notation :Representing Specializaiton and Generalization in UML Class Diagrams
  7. Data Abstaraction, Knowledge Representation, and Ontology Concepts
  8. Summary

1. Subclasses, Superclasses, and Inheritance

2. Specialization and Generalization

  •  용어 정의 
    용어 정의
    Entity type(=class) 같은 속성을 가진 개체의 집합
    class 개체의 집합
    Subclass super class에 포함되는 entity의 부분 집합 super class와 subclass를
    IS-A relation ship으로 표현
    Superclass subclass의 본체
    Inheritance superclass의 속성을 subclass가 갖게 되는 것을 의미
    Specialization entity type(super class)의 subclass를 정의하는 프로세스.
    super class를 specialization하면 superclass의 속성을 subclass가 상속받는다.
    Generalization 여러 entity type에서 공통 기능을 식별하여 단일 superclass로 만드는 프로세스.
    subclass를 generalization하면 superclass가 된다.
  • IS-A Hierarchies를 사용하는 이유 
    - subclss에 특정한 descriptive 속성을 추가하기 위해서
    - relationship에 참여하는 entity를 식별하기 위해서
  • Subclassses in data modeling
    - model specific attributes : subclass는 superclass의 특성을 상속받고, 추가적인 속성을 갖는다. 
    - model specific relationship on subclass

3. Constraints and Characteristics of Specialization and Generalization Hierarchies

  • predicate-defined/attribute-defined
    - subclass S의 membership이 같은 조건으로 정의되는 속성을 supclass C의 추가 속성으로 만들었을 때, Subclass S의 defining predicate으로 표현한다. S=C[P]
    - 모든 specialize된 subclass가 superclass의 공통 속성으로 membership condition을 가질 때, specialization은 그 자체로 attributed-defined specialization으로 정의되고, 그 속성은 defining attribute라고 부른다.
  • user-defined
    -subclass에서 membership을 결정하는 조건이 없을 경우 subclass는 사용자가 subclass에 entity를 추가하는 작업을 수행하고, user-defined subclass가 된다. membership은 자동으로 결정되는 것이 아니라 entity에 따라 별개로 specify된다.
    - diagram에서는 circle이 없는 형태로 그려진다.
  • disjoint / overlapping / total / partial
    (1) disjoint constraints
     - 다른 subclass와 공통의 entity가 없는 경우 disjoint라고 한다.
     - attribute-defined이면서 단일 값 속성을 갖는 경우 disjoint subclass이다.
     - diagram에서는 원 안의 d로 표현한다.
    (2) overlap
     - 하나의 entity가 2개 이상의 subclass에 동시에 포함되어 있는 경우 overlap이라고 한다.
     - diagram에서는 원 안의 o로 표현한다.
    (3) total specialization
     - super class의 모든 entity가 특정 subclass의 member가 되는 경우를 의미한다.
     - diagram에서는 ==(double line)으로 표현한다.
    (4) partial specialization
     - 전체 참여의 반대. super class의 entity의 일부반 subclass의 member가 되는 경우
  • insertion & deletion rules for specialization / generalization
    - superclass의 entity를 삭제할 경우, subclass에서도 삭제된다.
    - superclass에 entity를 추가할 경우, predicate-defined subclass에도 추가된다.
    - total specialization의 superclass에 entity를 추가할 경우, 적어도 한개 이상의subclasss에 추가된다.
  • Specialization hierarchies & lattices
    - hierarchy : single inheritance(in java)
    - lattice : multiple inheritance(in cpp..)
  • Top-down || Bottom-up conceptual design
    - Top-down : successive specialization
    - Bottom-up : successive generalization
    - and combination of two 

4. Modeling of UNION Types Using Categories

  • Union type(=category)
    - 사용자가 생성한 가상의 class. 다른 entity 개체로부터 임의로 entity collection을 만들고 이를 union이라고 부른다.

참고문헌 : Fundamentals of Database Systems 7th Edition