Jody Garnett a écrit :
> - deprecate *all* factory finder methods and place them in an ext/ so
> that our code is forced to use injection
Deprecating factory finders was not my plan... Style and Filter factory finders
are not implemented as they should be. But referencing factory finder (for
example) should fit the needs - it already cover non-trivial hints cases.
"FactoryFinder.getFooFactory(hints)" or "new FooFactory(hints)" can be see as
kinds of constructor injection. Factory dependencies are specified as a map of
hints instead of explicit argument, but in both cases they are processed at
construction time.
Cons:
* Supported hints are not visible from an API point of view.
User needs to read the javadoc.
* Hints are not supported by picocontainer and similar.
Pros:
* User specifies all the hints he care about (and only the hints he care
about), no matter if it is supported by the Factory or not. The factory
will pickup the relevant hints from the map. For example the user may set
a COVERAGE_PROCESSOR hint. CRSFactory will ignores this hint, but other
factories may use it. User can just specify all his need once without the
need to adapt his request on a factory-by-factory basis.
* A Map is extensible, while constructor arguments are not extensible without
a compatibility break. If a new dependency is introduced in future factory
version, adding an argument to the constructor requires at least a
deprecate
- remove release cycle and requires updating every methods that invoke this
constructor. Using a Map, we can process with no API change.
* Hints provide some flexibility not available with constructor or method
injection. Again, how can we said "any CRS factory enforcing (longitude,
latitude) axis order" with constructor/method injection?
Actually both approachs:
- Constructor(Hints)
- Constructor(Factory1, Factory2...)
can probably live together in most cases. So doing one approach do not exclude
the other.
Martin
-------------------------------------------------------------------------
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