Martin Desruisseaux wrote:
> Le mardi 16 janvier 2007 à 10:24 -0800, Jody Garnett a écrit :
>   
>>> Is there any reason why the utility class we use ( FactoryFinder,
>>> CommonFactoryFinder, etc... ) shouldn't cache all factory lookups? The
>>> only argument I could make is that this would not allow us to be
>>> dynamic. However I don't think anyone really has this requirement, and
>>> if they do they probably are not using the factorySpi mechanism as their
>>> plugin method. Thinking of eclipse and spring.
>>>       
> There is two kind of FactoryFinder. The old, deprecated one, which does
> a full class scan everytime a method is invoked. And the new ones built
> on top of FactoryRegistry (e.g. FactoryFinder in "referencing" and
> "coverage" package). Those later FactoryFinder do cache the factories.
>   
Martin has the old FactoryFinder been deprecated long enough that it can 
be removed from
GeoTools 2.4 ?
> I never upgrated the FactoryFinder outside the "coverage" and
> "referencing" modules mostly because I was scared to break existing
> code. If we accept this risk, I may volunter for upgrating some of them
> and see what happen.
>   
I have tried upgrading a few of them; and prepared some developers guide 
pages on the the Factory Finder mechanism - but I also have
not rolled out the FactoryRegistry one.
> There is also an other reason: some peoples wish constructor injection.
> FactoryFinder would then be a mechanism for providing default values
> when no explicit instance is given to the class constructor. The client
> code need to store the factory reference in its fields once for ever at
> construction time, so it is already acting as a cache.
>   
We should revisit this with the "factory finder" blocker issue that uDig 
has added (to ensure a OSGi based lookup will
indeed work).

Justin has produced something like a container for his parser, the same 
problems (configuration based factories) plague us
in the rest of the library.  Maven went with it's own micro container 
implementation, perhaps we would do best to follow suite.

We could take a deliberately step in this direction rather then watch 
common factory finder evolve to meet the same needs.
Jody

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to