lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: Why is final?
Date Tue, 13 Jul 2004 16:04:54 GMT
Kevin A. Burton wrote:
> Doug Cutting wrote:
>> Field and Document are not designed to be extensible. They are 
>> persisted in such a way that added methods are not available when the 
>> field is restored. In other words, when a field is read, it always 
>> constructs an instance of Field, not a subclass.
> Thats fine... I think thats acceptable behavior. I don't think anyone 
> would assume that inner vars are restored or that the field is serialized.

You'd be surprised what people would assume!

The bottom line is that making this non-final would enable you to do 
anything that you cannot do today, and it would permit lots of folks to 
try things that won't work, get confused, and complain.  Part of the job 
of an API is to steer you towards best practices and away from dead 
ends.  If there were important functionality that would be enabled by 
making this non-final then I'd be for it.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message