On 08/26/2016 03:36 PM, Darren Hart wrote:
The previous language disallowed overriding properties in derived
property sets but allowed for it via multiple inheritance, thus doing a
poor job enforcing the intent that properties are aggregated, not
overridden.
Correct the language to explicitly disallow overriding property
definitions. Include a practical exception allowing identical property
definitions in multiple base property sets.
Signed-off-by: Darren Hart <dvhart(a)infradead.org>
---
documentation/database_rules.txt | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/documentation/database_rules.txt b/documentation/database_rules.txt
index faa822b..2ab7b0a 100644
--- a/documentation/database_rules.txt
+++ b/documentation/database_rules.txt
@@ -102,7 +102,8 @@ further subsets.
To facilitate re-use of existing definitions of properties and property
subsets, the database is designed to allow new property sets to be built
on top of existing ones and to inherit property items (i.e., properties
-or property subsets) from them.
+or property subsets) from them. The process is strictly additive,
+overriding property definitions is not permitted.
The property set whose property items are inherited is referred to as a
base set. The property set inheriting property items is referred to as
@@ -123,18 +124,14 @@ defined.
As a rule, a derived set contains all of the properties from all base
sets along with the properties defined in it directly. However, if two
-or more base sets contain a property with the same key, the derived set
-inherits the property from the first base set listed in the definition
-of the property. For example, if property set C is derived from set A
-first, and then set B, and both sets A and B contain a property called
-"maximum", then C would use the property definition from A;
"maximum"
-from B would be discarded.
-
-Direct definitions of properties in the derived set cannot override
-any properties inherited from the base sets. Such property definitions
-will be considered an error. That is, if property set B derives from
-set A, and A has a definition of property "my-property", B cannot also
-contain another definition for "my-property".
+or more base sets contain a property with the same key, the property
+definition must be identical in all cases. For example, if property set
+C is derived from set A first, and then set B, and both sets A and B
+contain a property called "maximum", both A and B must define
"maximum"
+in the exact same way. Similarly, if C were to define "maximum"
+directly, it must match the definition of A and B exactly (although
+there is no reason to do so). In short, overriding property definitions
+is forbidden, doing so will be considered an error.
In general, inheritance should be limited to individual vendor
directories. Cross-vendor inheritance of property sets, although
Applied. Thanks!
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3(a)redhat.com
-----------------------------------