Re: Clone method
- From: "Brian Gideon" <briangideon@xxxxxxxxx>
- Date: 5 Jun 2006 06:27:04 -0700
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 ***
.
- Follow-Ups:
- Re: Clone method
- From: Mark Wilden
- Re: Clone method
- References:
- Clone method
- From: csharpula csharp
- Clone method
- Prev by Date: Re: Access denied while trying to create a mutex.
- Next by Date: Re: Strategic Functional Migration and Multiple Inheritance
- Previous by thread: Re: Clone method
- Next by thread: Re: Clone method
- Index(es):
Relevant Pages
|