ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject Re: Generic Element Containers (generalization of TaskContainer)
Date Fri, 30 Nov 2001 15:10:00 GMT
On Sat, 1 Dec 2001 01:57, Jose Alberto Fernandez wrote:
> Stefan point about making <fail/> contain conditions brings back something
> I have been thinking about for a while.
> Today, we have special treatment of TaskContainer which allows a task
> to declare that any task (or DataType) can be defined as nested elements.
> But more and more we have other Tasks that can be containers for some
> particular subset of elements. The typical example is <condition>. Today
> the way we deal with this is to add new methods to <condition> every time
> we define a new <conditional> quite unmanageable when we keep on adding
> more and more conditions, almost unmannageable now that we may have two or
> three different containers, and really unmanageable if we ever provide
> pluggable user defined conditionals.
> The same occurs for <mappers> <cullers>, etc. Specifying implementation
> class names looks really awfull.


> Can we come-up with a way to generalize what we do for TaskContainer?

we have already agreed to do so for Ant2...

> If we provide a way for the Container to indicate which king of thing it
> can contain then the problem could be solved. 

By accepting an interface rather than a implementation?

> So rather than having seratetly managed hashtables for different things we
> could have one unified symbol table controlled by ANT in which things are
> registered by cathegory: task, condition, datatype, culler, mapper, etc.

you mean by "type" - I think thats a given.

> When you decare an object to ANT, like with my infamous <antlib/> you
> specify onder which cathegory(ies) you want it declared:
>     <antlib>
>         <element name="echo"
>                         class=""
>                         cathegory="task" />
>         <element name="glob"
>                         class="...."
>                         cathegory="mapper" />
>     <antlib/>

Does anyone ever read anything I write?

Perhaps we could go with the format I already described.

  <task name="echo" class=""/>
  <mapper name="glob" class="...." />

And a separate descriptor to match "role" name (ie mapper/task) to interface 

  <role name="mapper" class="org.apache.ant.framework.Mapper"/>

> I think this would provide a quite extensible, easy to manage and
> consistent mechanism.

Right - something I have been promoting near on a year. 



| Despite your efforts to be a romantic hero, you will |
| gradually evolve into a postmodern plot device.      |

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message