You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by "Krug, Holger" <Ho...@entire.de> on 2004/10/14 08:31:23 UTC

schema extension proposal

Hi,

I'm new to this list. Greetings to all and thanks to Howard for this
great IoC container.

I have been using hivemind for several weeks now. I make extensive use
of configuration points. Quite often I end having schemas consisting of
one element and it's attributes only and contributions of e.g. the
following kind:

<adapter adaptee-class="a.b.c" adapter-type="c.d.e"
adapter-class="f.g.h"/>
<adapter adaptee-class="a.b.c" adapter-type="i.j.k"
adapter-class="l.m.n"/>
<adapter adaptee-class="a.b.c" ... />
<adapter adaptee-class="x.y.z" ... />

Some of the attributes (here: adaptee-class) have identical values in
several elements. The natural approach would be to extend the schema and
to allow contributions like:

<adapters adaptee-class="a.b.c">
  <adapter adapter-type="c.d.e" adapter-class="f.g.h"/>
  <adapter adapter-type="i.j.k" adapter-class="l.m.n"/>
  <adapter .../>
</adapters>
<adapter adaptee-class="x.y.z" ... />

The single purpose of the surrounding element "adapters" would be to
provide default values for some of the attributes of the inner elements.

Among the different ways to implement support for such behavior I prefer
to extend hivemind schemas, which currently only contain "elements".
New schemas could contain "grouping-elements" beside standard
"elements". A potential schema for the example about would be:

<schema id="adapter-schema">
  <grouping-element name="adapters"/>
  <element name=adapter>
    <attribute ... />
  </element>
  ...
</schema>

Grouping elements could be defined whereever elements may be defined. In
a contribution a grouping element may contain other grouping elements of
the same type and elements of types defined together with the grouping
element. For rule processing the grouping elements do not exist. Their
sole purpose is to provide default values of attributes, which may be
overridden by inner grouping elements and by elements proper. For rule
processing it's like all grouping elements being removed and further
attribute values added to elements.

3 questions:
- Would an extension like outlined above accepted for integration into
hivemind ?
- Where would I have to extend hivemind code to achieve my goals ?
- Which extensions of the <schema> element are planned in future ? I cite
from the docs: "At a future time, the <schema> element will be extended to
provide more options, to provide more precise control over the elements that
may be provided in an <contribution>."

Greetings,
Holger Krug


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org