Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Three coding questions

Adrian Custer wrote:
3) uDig/Geotools: How do we use FactoryFinders?

I'm kind of confused by all the Factories, FactoryBuilders and
FactoryFinders around. It seems there are several FactoryFinders which
means we have to find the Finders. Is there an explanation of what each
of them do? Is the idea eventually to have a single 'FactoryFinder'
instance that does really find all the factories for all the different
types of objects?

This idea of a FactoryFinder is really really old (aka GOF era), the AWTToolkit amounts to a FactoryFinder. Modern people use a "container" and we are working on setting geotools up for that for the geotools 2.3.x release.

To use a Factory Finder call its static methods and ask it to locate a factory for you. How does it find a factory? Based on the geotools plug-in system (basically what is in your classpath). For something like uDig that uses a plugin system that restricts classpath the answer gets hard really quickly and involves "buddy classloaders".

For a more detailed account of what is going on in geotools, and why, try this article. - http://docs.codehaus.org/display/GEOTOOLS/Objects%2C+Interfaces+and+Factories

Cheers,
Jody



Back to the top