You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2011/03/21 17:39:54 UTC

Dn, RDn, Ava : Final classes ?

Hi guys,

do you think it's a good idea to make the Dn, Rdn and Ava classes final ?

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: Dn, RDn, Ava : Final classes ?

Posted by Alex Karasulu <ak...@gmail.com>.
No worries. Thanks for the heads up.

Sent from my iPhone

On Mar 22, 2011, at 2:26 PM, Emmanuel Lécharny <el...@apache.org>  
wrote:

> I reverted the change made on those classes a while back (they where  
> all final) We can make them final if needed later, but I don't think  
> it was a good idea to have made them final at first (most certainly  
> my fault).
>
> We can continue the discussion further.
>
> On 3/22/11 12:31 PM, Alex Karasulu wrote:
>> On Mon, Mar 21, 2011 at 7:21 PM, Emmanuel Lécharny<elecharny@apache.or 
>> g>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
>>
>
>
> -- 
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>

Re: Dn, RDn, Ava : Final classes ?

Posted by Emmanuel Lécharny <el...@apache.org>.
I reverted the change made on those classes a while back (they where all 
final) We can make them final if needed later, but I don't think it was 
a good idea to have made them final at first (most certainly my fault).

We can continue the discussion further.

On 3/22/11 12:31 PM, Alex Karasulu wrote:
> On Mon, Mar 21, 2011 at 7:21 PM, Emmanuel Lécharny<el...@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
>


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: Dn, RDn, Ava : Final classes ?

Posted by Alex Karasulu <ak...@apache.org>.
On Mon, Mar 21, 2011 at 7:21 PM, Emmanuel Lécharny <el...@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

Re: Dn, RDn, Ava : Final classes ?

Posted by Emmanuel Lécharny <el...@apache.org>.
On 3/21/11 5:43 PM, Alex Karasulu wrote:
> On Mon, Mar 21, 2011 at 6:39 PM, Emmanuel Lecharny<el...@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. Also it might be 
faster (inline methods, etc)

Just wanted to hear other's opinion here.


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: Dn, RDn, Ava : Final classes ?

Posted by Alex Karasulu <ak...@apache.org>.
On Mon, Mar 21, 2011 at 6:39 PM, Emmanuel Lecharny <el...@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?

Alex