Peter Donald wrote:
> Sent: Thursday, 14 February, 2002 08:41
> To: Avalon Developers List
> Subject: Re: [PATCH] Re: Cascading Configuration
>
>
> I agreee that some form of merging of config trees is useful and
> whether it is done via some sort of new merging Configuration
> implementation or via some more explicit mechaism then it woulld
> still be useful. The client still sees a simple configuration tree
> so there does not need to be any knowledge of backend representation.
>
> However you still didn't answer my queries :) Here are some of them again
I didn't answer them because I'm not interested in "merging" :-).
Why merger hundreds of configurations when all you need to do is to create
typically short chain of references. The problem below is that your
NEED to ask these questions because there is structural change that your
applying. I thinking more and more that its much better to preserve the
configuration and shift to a conceptual model of overlaid configurations.
For example, the release-configuration, the site-configuration, the
user-configuration. You don't need to make any decisions about structural
change because your not looking as the hierarchy - your looking at a chain
of nodes through the overlays [I think I repeating myself]!
But ok - I'll look at the questions (grudgingly).
> > > The main reason is there are different
> > > strategies to
> > > use when merging consider the following
> > >
> > > Source: <a/>
> > > Default: <a><b/></a>
attributes on source <a/> override <a> attribute on default
attributes on default <a> supplement apparent attributes on <a> source
a getChild("b") on source returns <b> from default
getChildren on source <a> returns default <b>
getChildren on source returns <a/> from source and <a> from default.
> > > The result will most likely be equal to the "Default" tree.
> > > But
> > > what happens
> > > in the following cases
> > >
> > > Source: <a><b/></a>
> > > Default: <a><b/></a>
> > > Do we double the B or replace it?
Getting the children on Source would return <a> from source and <a> from
default.
Getting the child of <a> would return source <a> backed by default <b>
Getting the children of <a> on source would return <b> source and <b>
default
So the answer to you question is YES!
Ok - this is getting boring - the things is that there are several
distinctly different transformations that you need at runtime (and merging
constrains you to only one).
- flattening of attribute values (source takes precedence over default)
- child lookup generates a chain of nodes, but the child
composition of the nodes isn't lost or flattened
- all chld nodes of equivent named nodes n deep consititue the
the apparent set of child nodes
> > >
> > > Source: <a><b x="1"/></a>
> > > Default: <a><b/></a>
> > >
> > > Do we double the B or replace it?
You double on aggregation and you replace on lookup. I.e.
source.getChildren("a")
returns <b x="1"/><b/>. Source.getChild("a") returns logically flattened
<a>
from source + <a> from default.
> > > Source: <a><b x="1"/></a>
> > > Default: <a><b y="2"/></a>
> > >
> > > Do we double the B or replace it or merge it?
Double on Source.getChildren(), merge on Source.getChild("b").
> > > Source: <a><b x="1"/></a>
> > > Default: <a><b x="2" y="2"/></a>
> > >
> > > Do we double the B or replace it or merge it?
Double on Source.getChildren(), merge on Source.getChild("b").
Source.getChild("a").getChild("b).getAttribute("x") = "1".
Source.getChild("a").getChild("b).getAttribute("y") = "2".
Source.getChildren() = <a><b x="1"/></a><a><b x="2" y="2"/></a>
Source.getChild("a").getChild("b") appears as <b x="1" y="2"/>
Source.getChild("a").getChildren() = <b x="1"/><b x="2" y="2"/>
> > > etc.
> > >
> > > Mergin attributes is simple and well understood but the ability
> > > of merging trees is less so - which is why we should keep it in a
> > > utility method and keep that in excalibur until we are more
> > > certain of it.
I don't think we should consider tree merging.
I do think we should consider management!
Cheers, Steve.
> > > --
> > > Cheers,
> > >
> > > Pete
> > >
> > > --------------------------------
> > > My opinions may have changed,
> > > but not the fact that I am right
> > > --------------------------------
> > >
> > > --
> > > To unsubscribe, e-mail:
> >
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
>
> --
> Cheers,
>
> Pete
>
> -----------------------------------------------------------------------
> | I thought there was a knob on the TV to turn up the intelligence. |
> | There's a knob called "brightness", but it doesn't work. |
> -----------------------------------------------------------------------
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>