Try OpenEdge Now
skip to main content
Object-oriented Programming
Programming with Class-based Objects : Serialization and deserialization

Serialization and deserialization

Serialization is a way of saving a class-based object so the object can be recreated later or in a different context. The serialization process stores the values of an object's instance data members, properties, temp-tables, and ProDataSets. Deserialization is the process of then recreating the object using those stored values.
You can take advantage of the serialization/deserialization process for several use cases. For example, you can :
*pass an object between an AppServer and a remote ABL client
*save the objects that make up the context of an AppServer session, so that context is available no matter which agent happens to handle subsequent requests from the client
*save the objects that make up the context of an ABL client so that a given task can be resumed at a later time.
In the case of passing objects between an AppServer and ABL client, the AVM handles the actual serialization/deserialization process, but for the other cases, you must manage the process, using the built-in file stream classes and the serialization/deserializaton classes.
* Serializing an instance to file
* Deserializing from a file