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.
right. > 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="org.apache.tools.ant.taskdefs.Echo" > 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. <antlib> <task name="echo" class="org.apache.tools.ant.taskdefs.Echo"/> <mapper name="glob" class="...." /> <antlib/> And a separate descriptor to match "role" name (ie mapper/task) to interface classname. <roles> <role name="mapper" class="org.apache.ant.framework.Mapper"/> </roles> > I think this would provide a quite extensible, easy to manage and > consistent mechanism. Right - something I have been promoting near on a year. -- Cheers, Pete *------------------------------------------------------* | Despite your efforts to be a romantic hero, you will | | gradually evolve into a postmodern plot device. | *------------------------------------------------------* -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
