Difficulty: Easy
Correct Answer: Valid (bidirectional with inverse is required)
Explanation:
Introduction / Context: The ODMG (Object Database Management Group) specification defined a standard object model and bindings for object databases. A key feature is how relationships between objects are modeled and kept consistent. This question asks whether relationships are defined in both directions with an inverse declaration to maintain referential consistency.
Given Data / Assumptions:
Concept / Approach: In ODMG, relationships are typically declared bidirectionally with an inverse to ensure that updates to one side are reflected on the other. This helps the database maintain referential integrity and provides navigability from either related object without additional joins or lookups.
Step-by-Step Solution:
Consider a one-to-many: a Department has employees; each Employee has one department.Declare Department.employees with inverse Employee.department.When you add/remove an Employee from Department.employees, the inverse is updated so Employee.department stays consistent.Therefore, specifying both directions (with inverse) is the ODMG norm and requirement for consistent navigation.Verification / Alternative check: Review ODMG examples: relationships include explicit inverse clauses guaranteeing bidirectional integrity across navigations.
Why Other Options Are Wrong:
Common Pitfalls: Forgetting to declare inverses leads to dangling or asymmetric links; attempting to mimic bidirectionality in application code instead of the model; mixing relational foreign keys semantics with object references without defining inverse consistency.
Final Answer: Valid (bidirectional with inverse is required)
Discussion & Comments