Justin Deoliveira ha scritto:
> I don't think that there should be a factory finder at all. Instead code
> that needs a StyleFactory or a FilterFactory should declare a setter or
> a constructor argument.
>
> I think a "finder" should only be used when there are multiple
> implementations of a particular interface , and you need to iterate over
> them. Not for a class that just needs a single implementation. How does
> the finder know which one to use if there are multiple implementations
> around? This is a decision should be left up to the end user /
> application imho.
I think there is a significant use case: when the user wants to set a 
library wide default and be done
with it. The alternative is to provide setters for factories in every 
piece of code that needs them and
have client code inject the factories everywhere.
Think about people willing to use their own Feature implementation.
Alternative 1 is to pass a factory to every call that can build a 
feature, altenative 2 is to set a library
wide chooser. Alternative 1 is not so bad, just not very convenient...

Martin, do you have better examples?

Cheers
Andrea

-------------------------------------------------------------------------
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