Link to home
Start Free TrialLog in
Avatar of List244
List244

asked on

Class serialization

I have a couple questions, first, what are common methods of serializing a class?

Second, why serialize a class?  Serializing a class, if I am not mistaken would cause the class to only allow one
instance rather than several due to the fact that it would load and save instances, making two separate serialized
instances impossible.
ASKER CERTIFIED SOLUTION
Avatar of Dariusz Dziara
Dariusz Dziara
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of List244
List244

ASKER

Mr.Blue, I am hoping for a little more input on the subject from some of the other experts, I have not abandoned the question.
If there is no further input, I will accept your answer sometime next week.  If there is other input, you can expect a splitting of
points.  (I like to hear different points of views on things.)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can go quite a ong way with this approach, but as you can see the voter class contains a vector of names and serialisation requires a different delimiter for the names (it uses '#' rather than '|'). XML parsing means you don't have to keep contriving different delimiters, but makes an Experts Exchange posting rather longer :-)
> Second, why serialize a class?  

Let's be pedantic here. You serialise objects not classes. You serialise them so that you can keep them or so that you can move them from one place to another (e.g. squirt them through a socket).
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial