ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: DataType interface?
Date Tue, 05 Jun 2001 07:23:11 GMT
Conor MacNeill <conor@cortexebusiness.com.au> wrote:

> I have considered there to be three components to a datatype.
> 1. The task level element used to create values of the datatype
> 
>   <fileset name="foo" .../>
> 
> 2. The nested element used to create an instance of the datatype
> within the context of another task
> 
>    <fubar ...>
>        <fileset .../>
>    </fubar>

If you make these two the same class you get the same kind of problem
we currently have in Ant1.  Say I invent my-improved-fileset and want
task foo to support it (which already supports filesets), then I need
to modify task foo (add an addMyImprovedFileset method to it).

The workaround is something like

<myimprovedfileset id="xyz"/>
<foo>
  <fileset refid="xyz" />
</foo>

which doesn't improve readabilty 8-)

David Rees has posted a proposal to this list (a loong while ago, and
I still haven't read it completely, shame on me) in which he outlines
a scenario where 

<foo>
  <fileset ....>
</foo>

would take into account all classes that could be passed to addFileset
(subclasses of FileSet in this case, but the same holds true for
arbitrary interfaces and implementing classes) and choose the one that
fits the supplied attributes - this is where it becomes dangerous
IMHO.

I'm not sure whether I'd want to go *that* far.

Stefan

Mime
View raw message