Re: Why can't I copy a collection class from one instance to another?



if this is common to classes in other
programming environments.

Yes, it is common to true object programming environments. You often have to
still write a clone method, but the properties and methods of the object
*usually* can be un-corked out to a serialized string that can be saved (in
fact, we call this serialization). It is this "string" of data that can
then be loaded back into the object.

This gives two benefits.

you can actually "save" the state of the object to your hard disk..and
next time you run the program...re-load the object. Thus, you can actually
use objects, and save them to a database, or even a file on hard disk.

The side benefit of this serialization process is that the code to clone
a object his thus very easy to write....

And, even more important, with web based services...you can *transfer* a
object across the connection this way.

So, if the language at hand does not support clone of the object (not all
do), but does support what we call serialization, then cloning is easy
anyway...

We have neither clone, nor serialization available in VB, or ms-access,
which by the way is the same as VB6...

You do have serialization in vb.net however.....


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@xxxxxxx
http://www.members.shaw.ca/AlbertKallal


.



Relevant Pages

  • Re: Newbie Q: Serialization and Me
    ... private / inner class and then use your serialization trick on *that* ... Dim bf As BinaryFormatter = New BinaryFormatter ... I have 2 objects and I want to make a deep copy of one into the ... I effectively want to clone an object into Me. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Backing Up Objects
    ... types of Objects where clone() does an actual clone and create a new ... using serialization. ... transient field with a particular name and there no longer is or a ... readResolve method that returns the singleton instance from a static ...
    (comp.lang.java.programmer)
  • ICloneable ... why type it out?
    ... Normally I call my method "Clone" ... ... traditional binaryformater and memory stream serialization and the method ... overload the Clone method and use custom serialization to instead convert ... but can you tell me a real reason for specifically ...
    (microsoft.public.dotnet.general)
  • Re: Saving decision tree
    ... Some objects provide a Clone function that returns a duplicate ... Public Property Let Copy ... ' code to de-serialize class data ... and Serialization are related as they are ...
    (microsoft.public.vb.general.discussion)
  • Re: Backing Up Objects
    ... types of Objects where clone() does an actual clone and create a new ... So if it's at all complex, I'm better using serialization? ... serialization means writing the data to a stream. ... readResolve method that returns the singleton instance from a static ...
    (comp.lang.java.programmer)