> This interface seems simpler to implement, but also significantly less
> 
> 
>  the one I was suggesting which allows to wrap the factory. Things you can do 
> with wrapping:
> powerful than
> ...
> So I'd go with the one I proposed, providing an abstract class that one can
> implement for the simple case of wrapping a factory to just hide processes in 
> it
> 
> 

Sounds fine. 
> > // global default?
> > Hints hints = new Hints(Processors.PROCESS_FILTER, new CustomProcessFilter()
> > );
> > 
> 
> 
> 
> Yeah, I considered this one too. did not propose
> I can go for it if everybody else feel it's the right way to go, why I
> it in my first mail:
> - a hint is variably treated in geotools from a ignorable suggestion
> 
> 
> in this case filtering might be security related so it has to be very clear 
> it's an to an order, order
> - hints are hard to discover, it's something you have to document in examples
> for people to learn the are there (similar to writing a large
> comment explainig
> messy code vs tight ones associated with clean code)
> 
> 

This is my problem with hints in general :-)  Since I agree ...

We should go for the first of those options; and make it part of the 
constructor...

interface ProcessFilter {
    ProcessFactory filter(ProcessFactory factory);
}


class Processors {
    final ProcessFilter filter;
    Processors(){
       this( new NullProcessFilter );
    }
    Processors(ProcessFilter filter ){
       this.filter = filter;
    }
    ....
   public Process process( Name name ){
      ...
   }
   public static final Process createProcess( Name name ){
      ...
   }
}

// example with no filtering
Process process = Processors.createProcess( name );

// example with filtering
Processors lookup = new Processors( new RenderingProcessFilter() );
Process process2 = lookup.process( name );

Nice and simple and explicit...
Jody

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to