ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: [patch] NioFileUtils, FileUtilsAdapter + factory (was Re: AW: Adding a methof to StringUtils)
Date Thu, 20 Apr 2006 15:48:55 GMT
Another thought about the factory--it should cache an
instance of each FileUtils type to minimize object
creation.  We can either just have it be known that
FileUtilsAdapter impls should be stateless or have a
StatelessFileUtilsAdapter interface--if implemented,
cache, else don't.

thoughts?

-Matt

--- Matt Benson <gudnabrsam@yahoo.com> wrote:

> --- Kevin Jackson <foamdino@gmail.com> wrote:
> 
> > > I found it in Kev's (long :) mail:
> > >
> > 
> > Sorry it was rather long, but there were a few
> files
> > packed in there!
> 
> parenthetical smiley above.
> 
> > > Since the other impls will be conditionally
> > compiled,
> > > we should use Class.forInstance()...
> > >
> > 
> > ok, so we use dynamic class-loading to get the
> > correct fileutils?  Is
> > there an example in the code already of how I
> should
> > do this, (like in
> > the ComplilerAdapter code perhaps?)
> > 
> That's the way I understand it.  Antoine cited
> Regexp
> factory stuff (o.a.t.a.util.regexp); it looks like
> the
> biggest lesson to take from here would be the use of
> ClasspathUtils:
> 
> return (FileUtilsAdapter)
> ClasspathUtils.newInstance(className,
> FileUtilsAdapter.class.getClassLoader(),
> FileUtilsAdapter.class);
> 
> -Matt
> 
> [SNIP]
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message