ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Re: [PATCH] Adding Dynamic elements for the n'th time
Date Wed, 27 Nov 2002 11:47:31 GMT
Stefan Bodewig wrote:
> 
> I agree (that we should agree 8-).  Could you define what you mean
> when you say "polymorphic behaviour"?  IIRC it has been a bit
> different from the notion other people on this list had.
> 

:-). Maybe only the notation.

Good point, however. My definition of polymorphism in Ant is that I should 
be able to extend a type and pass that new type to the task in place of the 
original. I think fileset and zipfileset are somewhat of an example 
(zipfileset may not obey Liskov, can't remember). Classfileset is another. 
When I committed classfileset, I could not upgrade all tasks, especially 
those outside Ant, to accept it in place of a standard fileset. The current 
approach is not that nice (defining a type instance with id and then 
refid'ing it at point of use).

So, this we should agree on as a desirable goal.

What comes next is the notation to express the use of derived type, and the 
underlying implementation in the core. In Mutant I advocated an explicit 
statement of the substitution and later found that this approach is also 
used in XML-Schema (I know not everyone likes this).

My original Ant 1 patch (which Magesh has cited) used a different approach 
where it tried to guess which underlying method is to be used. I haven't 
studied Magesh's patch in detail but for fully flexibly polymorphism, you 
need to identify the type of the object being passed and the method on the 
task to which you will pass it (i.e. two independent things). Using only one 
piece of information (the type name) has limits.

Conor


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message