lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Shane <sha...@LEXUM.UMontreal.CA>
Subject Re: LowerCaseFilter, is there a reason why the class is final?
Date Fri, 11 Sep 2009 14:35:05 GMT
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 

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 
> < <>> wrote:
>     Does anyone else see a way of doing this that is simple?
> -- 
> Ted Dunning, CTO
> DeepDyve

View raw message