ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Portier <...@outerthought.org>
Subject Re: having datatypes load classes
Date Wed, 09 Apr 2003 06:31:42 GMT


Stefan Bodewig wrote:
> On Tue, 08 Apr 2003, Marc Portier <mpo@outerthought.org> wrote:
> 
> 
>>but since that pattern is to be seen more around ant iteself, I was
>>hoping for some reuse here....
> 
> 
> One would think so, but the truth is that you'll find copy-paste reuse
> in this area instead of delegation or something.
> 
> Patches for a nice little utility class are welcome 8-)
> 

Stefan,

thx for the invitation, if others want to be on the party: please 
join.

Have to think about this some more,
and have to read the replies from Dominique first (which at first 
sight seem to go somewhat over the 'nice little' attributes that 
I was seeking as well)

woke up with something along the lines of a
ClassLoaderFactory (name should be tuned down a bit, too much 
expectations here, inspiration welcome, PathUtil?)
  - public ClassLoader getClassLoaderForPath(Path);

having the responsibility to check off against the project map of 
references (as does the Definer)

possibly having a variant
  - public ClassLoader getUniqueClassLoaderForPath(Path)

while the first would follow the documented rules of the 
ant.reuse.loader property, the latter would always make a new 
one, and never store that in the references map.

in fact if ant.reuse.loader == false the behaviour of both 
methods would be equal.

combination of both offers the flexibility to cover all the use 
cases I see

I'm guessing this approach would offer the least pressure on 
having to rethink more interfaces/existing stuff. (compared to 
e.g. introduction of the ClassLoader datatype that was suggested 
in the thread I mentioned)
Another advantage I see is that it's orthogonal to existing 
stuff, so people could just use it without neading to switch to 
cvs head or something (me included :-))
The real effort would be in refactoring and testing the existing 
implementations to use this utility then (but that's somewhat 
future music)

(also thinking about singleton vs statics for the beast)

not overseeing _all_ use cases, and some general greenhorn 
feeling around the complete internals of ant makes me hesitate 
and think some more first though.

but again, all of this might be in the answers from Dominique 
already.

regards,
-marc=

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

-- 
Marc Portier                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at              http://radio.weblogs.com/0116284/
mpo@outerthought.org                              mpo@apache.org


Mime
View raw message