A developer can use serialization to execute tasks like:
- Using a web service to send the object to a distant application
- Object transfer from one domain to another
- Using a JSON or XML string to pass an object via a firewall
- Keeping security or user-specific data consistent across applications
In computing, serialisation or serialization is the process of transforming a data structure or object state into a format that can be saved (e.g., in a file or RAM data buffer) or communicated (e.g., over a computer network) and then rebuilt in a new computer environment.
When the resulting series of bits is reread using the serialization format, a semantically identical clone of the original object can be created. This technique is not straightforward for many sophisticated objects, such as ones that use a lot of references. Serialization of object-oriented objects does not include any of the methods that were previously connected with them.
In some cases, serializing an item is also referred to as marshaling an object. Deserialization, on the other hand, extracts a data structure from a series of bytes (also called unserialization or unmarshalling).