avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berin Loritsch" <blorit...@apache.org>
Subject RE: [Proposal] Minor config change--ease of use
Date Tue, 11 Jun 2002 12:31:13 GMT
> From: Peter Royal [mailto:proyal@apache.org] 
> 
> On Friday 07 June 2002 03:13 pm, Berin Loritsch wrote:
> > Configuration family = processFamily(...);
> > Configuration strip = processStrip(...);
> >
> > family.addChild(strip); family.addChild(strip.branch("peg-strip"));
> > family.addChild(strip.branch("vert-peg-strip"));
> >
> > This frees me from being forced to do a lot of otherwise 
> complex logic 
> > at this level.
> >
> > Do others think that this would be useful?
> 
> I am unsure of how your example is different from:
> 
> family.alldChild( strip.getChild( "peg-strip" ) );
> 
> Or is branch the equiv. of:
> 
> Configuration branch( String newRoot )
> {
>   DefaultConfiguration c = new DefaultConfiguration( newRoot );
>   Configuration[] kids = this.getChildren();
> 
>   for( int i = 0; i < kids.length; i++ )
>   {
>     c.addChild( kids[i] );
>   }
> 
>   return c;
> }
> 
> If its the latter, I think it might be better in a separate 
> class as a static 
> utility method.
> -pete

It is more the latter--don't forget to copy the attributes...
All I am doing is changing the root name.


--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message