ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: [Patch] es to be submitted
Date Fri, 11 Apr 2003 14:46:29 GMT
Actually, that's interesting, and somewhat freaky because last night when I
was having trouble falling asleep, I thought some more about my DynamicTag
class, and I actually thought of stuff that could solve that particular use
case ;-)

See DynamicTag implements DynamicConfigurator, and you normal compose a
dynatag within your task (both examples I provided), but you can also make
your task itself implement DynamicConfigurator, and forward the call to a
pre-initializes private dynatag. Provided that the task then forwards the
maybeConfigure() call to the private dynatag, it's functionally equivalent,
except you can put any element that's the required type (FileSet in this
case) directly inside the task, instead of within the nested dynatag

The snag if that if you do that, you can have only one such implicit
dynatag, parametrized on a single expect type (can take an array of types to
satisfy, but applies AND logic on them). But then again you can still using
composition if you need to do polymorphism for several 'types' of

Nodoby looked at DynamicTag, so I guess I'm the only one seeing this ;-)

Cheers, --DD

-----Original Message-----
From: Stefan Bodewig [] 
Sent: Friday, April 11, 2003 9:36 AM
Subject: Re: [Patch] es to be submitted

On Fri, 11 Apr 2003, Dominique Devienne <> wrote:

> What's going on around the idea of Polymorphism in Ant? (beyond
> <datatype refid="xyz" /> that is)

The idea is to enable

<copy ...>
  <zipfileset src=""/>


<copy ...>
  <fileset src="" ant:type="zipfileset"/>

or something similar without doing anything in copy to make it aware
of ZipFileSet.

View raw message