directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Karasulu <akaras...@apache.org>
Subject Re: Dn, RDn, Ava : Final classes ?
Date Tue, 22 Mar 2011 11:31:20 GMT
On Mon, Mar 21, 2011 at 7:21 PM, Emmanuel Lécharny <elecharny@apache.org>wrote:

> On 3/21/11 5:43 PM, Alex Karasulu wrote:
>
>> On Mon, Mar 21, 2011 at 6:39 PM, Emmanuel Lecharny<elecharny@gmail.com
>> >wrote:
>>
>>  Hi guys,
>>>
>>> do you think it's a good idea to make the Dn, Rdn and Ava classes final ?
>>>
>>>
>>>  I'd avoid this because it would limit extension. Are we gaining a lot by
>> making them final?
>>
> Not that much, but as the classes are immutable, I was thinking that it's
> not really necessary to have them not final.


Immutability and extension are orthogonal concerns. You can still have
immutability in the base class, extend the class and add more fields that
are needed for some aspect of handling like we did for example with these
decorators in the codec for the req/resp classes.

Hence for the sake of the core properties they're still immutable but
extension may be an option left for users allowing the use of the class in
various scenarios we cannot think of in advance.

Also it might be faster (inline methods, etc)
>
>
Property accessor/mutators can be declared final but optimizations should
occur anyway, of course this is JVM dependent but I'd pass on small
optimization gains for now.


> Just wanted to hear other's opinion here.
>
>
I appreciate that.

Regards,
Alex

Mime
View raw message