IMHO, if I'm forced to write a by-pass filter to re-use a filter instead of copy/pasting it, I think we are getting way off the Decorator Pattern. Its not simple anymore. I bet you have 9 chances out of 10 that a dev. will copy/paste that code before writing a by-pass filter.

Extending the functionality of a filter should not be something difficult. And having everyone write their own bypass filter seems really annoying. Imagine all those people having to write the by-pass filter.

We should include such a filter in Lucene natively and add in the JavaDocs of the filter the mention that you can extend them with it to avoid people copy/pasting code.

If you want I can cook up a draft to get things started.

Daniel Shane

Ted Dunning wrote:

Copy/paste. Clearly Uwe and others were worried that users wouldn't be able to extend these classes compatibly. My own opinion is that this causes worse problems with back compatibility because people wind up copying code instead of calling it. You may be able to extend an abstract class to minimize your work.

On Fri, Sep 11, 2009 at 5:33 AM, Daniel Shane <sha...@lexum.umontreal.ca <mailto:sha...@lexum.umontreal.ca>> wrote:

    Does anyone else see a way of doing this that is simple?




--
Ted Dunning, CTO
DeepDyve


Reply via email to