In ODMG ODL, must a class's extent (the set of its persistent instances) be specified before declaring a key for that class, since keys uniquely identify objects within an extent?

Difficulty: Easy

Correct Answer: Applies — the extent is declared before the key for that class

Explanation:


Introduction / Context:
In ODMG, an extent is the named collection containing all persistent objects of a class. A key identifies objects uniquely within that extent. Understanding the dependency between these declarations is essential for correct schema design and for consistent object identity semantics across the database.



Given Data / Assumptions:

  • Each persistent class may declare one or more extents.
  • Keys are defined to enforce uniqueness of attribute values within a specific extent.
  • ODL declarations for a class typically include both extent and key in the class header.



Concept / Approach:
Because keys are applied to a collection of objects, the extent needs to exist conceptually before the key can be meaningfully interpreted. The common ODL idiom lists the extent first and the key second in the class/interface header, signaling that the key constrains members of the already-declared extent.



Step-by-Step Solution:
Declare the class/interface.Name the extent that will hold persistent instances.Declare the key that uniquely identifies instances inside that extent.Define attributes and relationships that participate in the key as needed.Implement operations; the key semantics carry through persistence and querying.



Verification / Alternative check:
Examine canonical ODL examples: class headers typically show extent followed by key. This ordering expresses the logical dependency of a key on its target collection.



Why Other Options Are Wrong:
Option b ignores the link between uniqueness and the collection to which uniqueness applies. Options c–e add conditions (composite, transient, relationship-based) that do not alter the fundamental dependence.



Common Pitfalls:
Choosing a non-stable attribute for the key; forgetting that keys must be unique across the full extent, not just within subgroups; misunderstanding that keys are about value-based identity, distinct from underlying object identifiers managed by the system.



Final Answer:
Applies — the extent is declared before the key for that class

More Questions from Object-Oriented Database

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion