For discussion sake, assume there is an object called Preferences that has 20 attributes.
The way these attributes should be determined is to follow a value inheritance scheme whereby duplicate definitions for an attribute are won by the most specific definition.
For instance, there may be 3 different data sets that must be considered to determine a Preference object's state, and each data set would need to be independently configured:
1. Initialize the object with the system default settings (for all users).
2. Process any preference overrides for the user's role/organization/etc.
3. Load the user's specific preferences.
Assuming level 1 is fully defined, values in subsequent (more specific) levels would override the (less specific) value if they were defined. If the more specific level had no opinion (null, etc.), the less specific value would stand.
Is there any way to model this type of structure with Hibernate?
|