On 07/06/2016 12:24 PM, Hart, Darren wrote:
There are a couple of items regarding the 0003-formal-language I’d
like to address/discuss:
1) The <parent-sets> and <set-list> elements will need to define handing of
circular references
and multiple inclusion, maybe in a new section. What is the policy for
circular
inclusion? It
could be include the first time, ignore subsequent inclusions (like
header
gates) or we could define
it to be invalid. Given we have minimal ability to change property
sets, I
recommend the more
forgiving former definition, and to document best practice of avoiding
circular
includes.
Interesting point. My inclination is to just ignore subsequent inclusions, and
mention that the circularity exists when found. I can't really see any use case
where doing more than that would be useful, but I am not omniscient, either.
As for multiple includes (possibly through multiple inheritance): A
is the base for B and C and D
derives from B and C, A is included once, and B and C cannot otherwise
conflict. We
can’t use
priority to resolve duplicate properties through inheritance since
that is
equivalent to overriding
a property type/data-validation, which we prohibit for
backward-compatibility
reasons.
I'm thinking "inheritance" may be the wrong term to use here; maybe we need
to rethink this part.
I personally tend to overload "inheritance" with C++ or Python semantics, so
it's confusing to me. I think what we're really trying to do is define a
superset out of existing sets, so a better keyword may be "extends:" or, to
borrow from DT, "compatible:".
Let me see if I can draw a little picture of the example so I can tell if I'm
understanding it properly:
Set A
|
+-----+----+ <= derives-from:
| |
Set B Set C
| |
+-----+----+ <= derives-from:
|
Set D
You can read this from top to bottom: Set D derives from B and C, which in
turn derive from A. I think the problem being described is that, if there
is a property "foo" in Set A, there is a "foo" in Set B and Set C. If
Set D
derives from Sets B and C, which "foo" should be used? Is that the concern?
What we currently say in 0002-database-rules (section 2.2) for this case is
that Set D would use the first "foo" in the set list; for example:
derives-from: B, C
would use the foo from B, but:
derives-from: C, B
would use the foo from C. Further, the document currently says that if B, C
or D define "foo", those would override any existing definition. That feels
pretty messy for what we're trying to do -- especially the part about over-
riding the definition, so that part at least has to fixed in the doc.
So, apart from changing the terminology from inheritance to sets and extends,
which I recommend, we could clarify that everything is distinguished by full
path. If we do, then Set A defines A/foo, and Sets B and C have A/foo, too.
When Set D derives from A, there's no confusion since it just uses A/foo. When
providing the _DSD package ASL, maybe the full path is needed there, too.
Does that make sense? I've rewritten this about three times now to try to
be clear but I'm not sure I've hit the mark yet...
2) There is no mention of hierarchical property sets in this
document. I would recommend
a directory for each, named with the key value. So for “Package(2) {“Alice”,
DP0P},
it
would be a subdirectory named “Alice”. However, this has a similar
specification problem
as I’ve raised before, in that it’s possible that there is the
possibility for
the DSD to
define DP0P to DPNP, each with the same set of properties. In this
case,
specifying “Alice”
in the property schema definition isn’t sufficient to document the
0-N usage.
Sorry, I'm being dense. Could you be more explicit with this example? I think
I see where you're going, but I'm not sure.
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Linaro Enterprise Group
al.stone(a)linaro.org
-----------------------------------