commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Clazz] subclassing vs. configuration (Was: Extending Clazz)
Date Fri, 20 Jun 2003 10:18:19 GMT
> > > 2. The reason all those things are implemented as subclasses rather
> > > than configuration-based instances is precisely to avoid the need
> > > for configuration.  In any complex environment you are working with
> > > lots of ClassLoaders, which are allocated by some container. 
> > > A ClazzLoader is  automatically allocated by Clazz for each 
> > > ClassLoader as needed. 
> > > Where would we put the hook for configuration?

> > But the fifth step, adding the new ClazzLoader,  _is_ a configuration
> > anyway. 

> It's done at the factory level: you register your custom ClazzLoader
> class (not instance) with a ClazzLoaderFactory.  The factory will
> instantiate it as needed.

Sorry, I do not understand it. You do not want configuration because 
you are not sure where to put the "configuration hook". But where
(in my client code) do I register the ClazzLoader class. Here
I have the "configuration hook". 

Or is the problem based on registering a ClazzLoader class 
and not an instance?
I have further looked into the code and the problem seems to be 
based on creating a ClazzLoader (zz) instance for each 
ClassLoader (ss). Is this necessary? Why not have another
getClazzForName(String) method that takes a ClassLoader?

   getClazzForName(String, ClassLoader)

Wouldn't that be much simpler?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message