Non-intrusive object serialization

  • Thread starter Sabyasachi Basu
  • Start date
S

Sabyasachi Basu

Most C++ object serialization techniques are intrusive, that is they
require all serializable classes need to have functions to stream in
and stream out their contents.

I came across "non-intrusive serialization" while going through the
tutorial on Robert Ramey's serialization library for Boost. However,
it is not clear to me how to implement serialization without the
cooperation of the classes being serialized.

Can someone through some light on this concept?

Thanks in advance.
Sabyasachi
 
C

Claudio Puviani

Sabyasachi Basu said:
Most C++ object serialization techniques are intrusive, that is they
require all serializable classes need to have functions to stream in
and stream out their contents.

I came across "non-intrusive serialization" while going through the
tutorial on Robert Ramey's serialization library for Boost. However,
it is not clear to me how to implement serialization without the
cooperation of the classes being serialized.

Can someone through some light on this concept?

By "non-intrusive", he means that the coupling of the class to be serialized and
the serialization mechanism is done by a third entity. This third entity is
created with the knowledge of how to extract and reconstitute another object's
data. Ramey's serialization library simplifies the specification of this third
entity.

Design-wise, this external coordinator is the cleanest approach, but it suffers
from redundancy and any changes to the class being persisted must be reflected
in the serialization helper. The only way to avoid this is to have a
preprocessor that generates the helper classes, and if you've ever dealt with
ODMG or even CORBA, you're probably cringing.

Claudio Puviani
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top