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: roles, restricted types
Date Thu, 12 Feb 2004 18:12:16 GMT
> From: Peter Reilly [mailto:peter.reilly@corvil.com] 
> 
> Hi,
> I have reactivated my code for restricted/roled types.
> 
+1
> The basic idea is that one can define a type that can only
> be used as a nested element in a type container. The type
> may not be used at the top-level.
> 
> The main usecase is to remove the need for type containers
> to implement all the allXX methods for current 
> conditions/selectors etc.
> 

I am all for it, the only thing I am not completely confortable
with is the fact that regular typedefs do not belong to some 
default "contract" (e.g., org.apache.tools.ant.TaskComponent)
or something like that. So there is some kind of asymetry in the design
and I am always suspisious of asymetries B-\

> For example there is an "or" condition, and an "or" selector.
> 
> The patch allows these two to be defined as restricted typedefs:
> 
>     <typedef name="or"
>              
> contract="org.apache.tools.ant.taskdefs.condition.Condition"
>              classname="org.apache.tools.ant.taskdefs.condition.Or"/>
> 
>     <typedef name="or"
>              
> contract="org.apache.tools.ant.types.selectors.FileSelector"
>              
> classname="org.apache.tools.ant.types.selectors.OrSelector"/>
> 
> 
> These may be placed in a antlib.
> 
> The idea would be to make an Ant antlib.xml containing all the 
> conditions. selectors,
> mappers and filters.
> 
> The user-level issues would be:
> Is the attribute "contact" a good name for this attribute 
> (use "role", 
> "restrict", "instanceof" or ?).
> 

How about "containertype" that would match better what you are trying to
describe:
the container type for the element.


> Should this be a separate task and not typedef.

I like it to be the same, the least amount of stuff to learn the better.

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


Mime
View raw message