directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Karasulu" <>
Subject Avoiding use of clone()
Date Sat, 27 Oct 2007 18:56:47 GMT
Hi Emmanuel, and others,

I was taking another look at these ServerEntry interfaces etc and noticed
that you define
the clone() method as supported within the interfaces themselves.

I may be wrong but I've always tried to avoid defining the clone() method in
interfaces and
have gone to great lengths to avoid using the clone() method.  I prefer to
use factories or
constructors instead.  For me the clone operation is scary and leads to a
lot of confusion.
Most of the time unless I have to support it because of a class I'm
extending I will deal with
it but when I can I try to avoid it.

Emmanuel was wondering if you see supporting clone() as critical and
recommend we keep

I know just having a feeling is not enough to say using clone is dangerous
but I've always ran
into issues with it and the variance in the semantics to the point where
dealing with it was not
worth the trouble.

Please could anyone with a clearer understanding of the pros and cons
provide some further
guidance on this topic?


View raw message