Difficulty: Easy
Correct Answer: An attribute of the supertype whose values determine the subtype
Explanation:
Introduction / Context:
The subtype discriminator is a cornerstone of implementing generalization and specialization. It provides a data-driven way to decide which subtype an instance of the supertype belongs to.
Given Data / Assumptions:
Concept / Approach:
A subtype discriminator is an attribute on the supertype whose value indicates which subtype applies. Example: a Person supertype may use attribute person_type with values Employee, Customer, or Vendor to determine the respective subtype.
Step-by-Step Solution:
Verification / Alternative check:
Design patterns for single-table inheritance or class table inheritance rely on a discriminator at the parent to route behavior or storage.
Why Other Options Are Wrong:
Common Pitfalls:
Thinking the discriminator belongs in each subtype; that would defeat consistent determination and introduce redundancy.
Final Answer:
An attribute of the supertype whose values determine the subtype
Discussion & Comments