ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: PropertyHelper thoughts
Date Thu, 14 Jun 2007 17:57:55 GMT

--- Peter Reilly <peter.kitt.reilly@gmail.com> wrote:

> On 6/14/07, Matt Benson <gudnabrsam@yahoo.com>
> wrote:
> > Urgh, looking over the PropertyHelper stuff, I
> wonder
> > if we shouldn't refactor it somewhat.  It seems to
> be
> > overly complex to allow full PropertyHelper
> delegates.
> Yes it is overly complex.
> (and full of bugs - esp with regard to child
> projects)
> 
> >  It seems that we might be better off using a
> single
> > PropertyHelper (still replaceable) and adding
> Lists of
> > getPropertyResolvers and setPropertyResolvers.
> This would be the way to go.
> 
> Perhaps something like:
> 
> interface GetPropertyResolver {
>     String resolve(Project a, String property);
>     // return null if not resolved
> }
> 
> interface SetPropertyResolver {
>     boolean setProperty(Project a, String property,
> String value)
>     returns true if property consumed
>     return false if not
> }

WRT the getPR interface, I am thinking something
exactly like this.  I'm not sure if we need any such
on the set.  Parsing properties for string expansion
is the other pluggable thing.  I'm thinking provide
interfaces for resolution and parsing, and register
delegates that are objects, check for instanceof at
runtime and add to the appropriate list, so a delegate
may implement either or both interfaces.  WDYT?

-Matt

> 
> Peter
> 
> >  One
> > obvious problem of the current implementation
> seems to
> > be that you can't do this:
> >
> > <property name="foo" value="foo.value" />
> > <registerpropertyhelper>
> >   <chain>
> >     <bashextendedpropertyhelper />
> >   </chain>
> > </registerpropertyhelper>
> > <echo>${foo:1,1}</echo>
> >
> > Because the PH that knows how to handle the
> extended
> > syntax wasn't around when "foo" was set and thus
> won't
> > know about the foo property (I could be wrong but
> this
> > is my impression of what the code is doing).  This
> > seems broken and extremely counter-intuitive to
> me.  I
> > am going to look into an extensive refactor of PH
> and
> > if we determine that necessitates 1.8, well, so be
> it.
> >  :|
> >
> > -Matt
> >
> > [SNIP]
> >
> >
> >
> >
> >
>
____________________________________________________________________________________
> > Be a better Heartthrob. Get better relationship
> answers from someone who knows. Yahoo! Answers -
> Check it out.
> >
>
http://answers.yahoo.com/dir/?link=list&sid=396545433
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> dev-help@ant.apache.org
> >
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 



      ____________________________________________________________________________________
Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo! Auto
Green Center.
http://autos.yahoo.com/green_center/ 

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


Mime
View raw message