ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <jalbe...@cellectivity.com>
Subject RE: Generic tasks/types WAS Possible Ant 1.7 alpha bug: property expansion.
Date Fri, 04 Jun 2004 18:30:35 GMT
Your example has this assumption, quite thin for the general case
that no matter what accion, the set of other attributes and
elements must be exactly the same.

I really do not see to much of the usability gain in something like
that.
Usually you expect different input for different actions. And when that
is the case, then the whole pattern is unusable. Now there may be some 
cases when it will work. But are there enough usages as to grant the 
definition of a full framework for this pattern.

I doubt it....

Jose Alberto

> From: Dominique Devienne [mailto:DDevienne@lgc.com] 
> 
> 
> One of the useful bit his proposal allowed was to 
> conditionally execute one mode or the other thanks to 
> mode="${mode}", where mode can be configured/computed 
> before-hand. If we had a way to configure and execute a task 
> in a similar indirect way, we'd achieve the same goal, will 
> still using different tasks. Here's what I mean:
> 
> You have tasks A and B which are interchangeable, i.e. take 
> the same attributes and nested elements, but do different things.
> 
> Instead of doing:
> 
> 	if some-condition
>         do-A
>       else
>         do-B
> 
> or doing Magesh's
> 
> 	<condition property="mode" value="A">
> 	  some-condition
> 	</condition>
>       <property name="mode" value="A">
> 	<A-orB mode="${mode}" [attributes]>
>         [elements]
> 	</A-orB>
> 
> We'd do something like:
> 
> 	<condition property="mode" value="A">
> 	  some-condition
> 	</condition>
>       <property name="mode" value="A">
> 	<task taskname="${mode}" [attributes]>
>         [elements]
>       </task>
> 
> This allows the necessary indirection, and avoids having to 
> Duplicate all the attributes and elements in an <if>.
> 
> This is similar to XSL's <xsl:element>, where the great 
> majority of time you just output the element directly, as in 
> <a>, but sometime need to dynamically set the elements name, 
> thanks to <xsl:element>.
> 
> Anyways, I hope this makes sense. --DD
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message