ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: DataType interface?
Date Tue, 05 Jun 2001 07:23:11 GMT
Conor MacNeill <> 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"/>
  <fileset refid="xyz" />

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 

  <fileset ....>

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

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


View raw message