Hi all,

I wanted to write this up while it is still fresh in my mind. For those
of us unfamiliar with the problem, the "factory problem" is this:

How do we enable the user to supplement geotools code with custom
factories. Why you ask. The number one use case is to get data stores to
create geometries and features optimized for rendering.

The way this has been done in the past is with the use of Hints. While
this solution works, a more explicit approach is often desired. The one
used more often then not is with containers. The use of hints is not
container friendly. To use the buzz word, a nice solution is
"constructor and setter injection".

So what we came up with is a couple of guidelines. If a data store uses
a factory, it should either:

1. Take the factory as a parameter in the constructor, or:
2. Add a setter method for the factory, but provide a default
implementation in the event where the setter is not called.

Having a class locate a factory implementation via factory finder spi is
 kind of pointless, it defeats the purpose of having an interface.



-Justin


-- 
Justin Deoliveira
[EMAIL PROTECTED]
The Open Planning Project
http://topp.openplans.org

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to