Serialization
Serialization
In sample openrider it seems serialization and unserialization have been used.Am I correct?I want to learn more on the topic in eC.Any more informations and guidance would be appreicated.
Re: Serialization
Hi Sam,
Yes I recently fixed some bugs relating to how these methods work, especially with the normal 'class' objects.
OnSerialize / OnUnserialize are part of the methods every type has.
There is also a default implementation for all types.
You can serialize / unserialize from an IOChannel class (File also inherits from IOChannel).
So you can do File f = FileOpen("someFile", write); f.Put(myObject) to serialize and f.Get(myObject) to deserialize.
Then you can override the default behavior if you want to control how a particular class is to be serialized/deserialized.
(De)Serialization is also used in EDA to store to or retrieve from a database types the database doesn't natively supports (blobs), and for network communication (e.g. distributed objects: remote class).
That's the basics! Let me know if you have any further questions.
Regards,
Jerome
Yes I recently fixed some bugs relating to how these methods work, especially with the normal 'class' objects.
OnSerialize / OnUnserialize are part of the methods every type has.
There is also a default implementation for all types.
You can serialize / unserialize from an IOChannel class (File also inherits from IOChannel).
So you can do File f = FileOpen("someFile", write); f.Put(myObject) to serialize and f.Get(myObject) to deserialize.
Then you can override the default behavior if you want to control how a particular class is to be serialized/deserialized.
(De)Serialization is also used in EDA to store to or retrieve from a database types the database doesn't natively supports (blobs), and for network communication (e.g. distributed objects: remote class).
That's the basics! Let me know if you have any further questions.
Regards,
Jerome