I think the point is that it should be up to the implementor which
method they want to use. If you want to use hints, use hints, if you
want to use injection, use injection, or use both if you are so inclined.

I think the end goal is to have the developer or user using the code
base to be able to supply an alternative, be it through hints or through
injection.

-Justin

Martin Desruisseaux wrote:
> Justin Deoliveira a écrit :
>> So I think code that does this:
>>
>> class Foo {
>>   FilterFactory filterFactory;
>>
>>   Foo() {
>>     filterFactory = FilterFactoryFinder.findFilterFactory();
>>   }
>> }
>>
>> should do this.
>>
>> class Foo {
>>   FilterFactory filterFactory;
>>
>>   Foo( FilterFactory filterFactory ) {
>>     this.filterFactory = filterFactory;
>>   }
>> }
> 
> The alternative that I was talking about (as used in modules that uses
> correctly the hints) is:
> 
> class Foo {
>   FilterFactory filterFactory;
> 
>   Foo(Hints hints) {
>     filterFactory = FilterFactoryFinder.findFilterFactory(hints);
>   }
> }
> 
> which leads to exactly the same result, with more flexibility (null
> hints for default, LENIENT_DATUM_SHIFT,
> FORCE_LONGITUDE_FIRST_AXIS_ORDER, etc). However one approach doesn't
> exclude the other. Both can live in parallel; Hints can actually be
> considered as an other flavor of constructor injection. More complete
> example:
> 
> class Foo {
>   FilterFactory filterFactory;
> 
>   Foo() {
>     this((Hints) null);
>   }
> 
>   Foo(Hints hints) {
>     this(FilterFactoryFinder.findFilterFactory(hints));
>   }
> 
>   Foo(FilterFactory filterFactory) {
>     this.filterFactory = filterFactory;
>   }
> }
> 
>     Martin
> 
> !DSPAM:1004,452e8ed0315632081064789!
> 


-- 
Justin Deoliveira
The Open Planning Project
[EMAIL PROTECTED]

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