|
-
Dec 12th, 2007, 02:13 AM
#1
Re: Cloning Objects
As a rule of thumb, stuff that's serialisable is generally cloneable, and vice versa.
-
Dec 12th, 2007, 03:04 AM
#2
Thread Starter
Member
Re: Cloning Objects
I understand that not every class should be clonable, namely value types. But surely every reference type should be? Why just the serialisable ones?
-
Dec 12th, 2007, 07:04 PM
#3
Special Guest - Microsoft
Re: Cloning Objects
 Originally Posted by trezise
I understand that not every class should be clonable, namely value types. But surely every reference type should be?
In many cases, cloning can not be done by simply copying the content of an object because it wouldn't be the right thing to do. There is an obvious question of whether it should be a deep or a shallow copy. Also, cloning is likely to lead to sharing of resources and only author of the type has the knowledge about what would the sharing mean and how it should be handled, if supported at all. So, it is up to the author to decide whether cloning feature should be available and how exactly it is going to be implemented.
Thanks,
Aleksey Tsingauz,
VB.NET Compiler Dev Team.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|