ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: DataType interface?
Date Tue, 05 Jun 2001 07:54:31 GMT
At 09:23 AM 6/5/01 +0200, Stefan Bodewig wrote:
>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.

hmm - that sounds interesting - and very similar to something cocoon2 has
done. Lets assume that FileSet is an interface. It has many implementing
instances that are registered in type registry (ie zip=ZipFileSet,
default=DefaultFileSet, tar=TarFileSet etc). Now imagine a syntax like

<foo>
  <fileset type="tar" ....>
    ...insert tar-specific elements/attributes here ...
  </fileset>
</foo>

So when mapping xml to instance the introspector/configurer would note that
FileSet is an interface. Look for the magic attribute "type" and look it's
value up in the "FileSet" section of TypeRegistry. This would allow
arbitrary plugging in ... not sure if it is worth it yet though. It is
interesting and doable. 

The only problem will be mapping from these "generic" types back into
simple types for tools like javac (who wouldn't handle FtpFileSet well).


Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


Mime
View raw message