Re: Clone method

Tech-Archive recommends: Speed Up your PC by fixing your registry



I assume you're talking about the ICloneable.Clone method. The is
answer is probably as long as the implementation actually makes a copy
of the member variables of the original object. There may be some
exceptions depending on whether the Clone implementation produces a
deep copy or a shallow copy.

The ICloneable interface never specified what kind of copy was to be
made. Microsoft would later regret the omission (see the Framework
Design Guidelines book) and has since mostly ignored its existence.
The problem is that interface didn't provide a behavioral contract. In
other words, you weren't sure what it was going to do exactly. As a
result the interface is mostly useless. In fact, Microsoft recommends
not using it at all (at least in public APIs).

Brian

csharpula csharp wrote:
Hello,
Have a basic question about Clone()
If I am using the clone method on some object ,are the Cloned object
properties going to change at every property change in original object?
Thanks!



*** Sent via Developersdex http://www.developersdex.com ***

.



Relevant Pages