Serialization is the process of taking objects and converting their state information into a form that can be stored or transported. The basic idea of serialization is that an object writes its current state, usually indicated by the value of its member variables, to persistent storage. Later, the object can be re-created by reading, or de-serializing, the object’s state from the storage. Serialization handles all the details of object pointers and circular object references that are used when you serialize an object.
In the NGWS frameworks message queuing feature, serialization refers specifically to the process of converting an object or set of data into a message that can be sent to a queue, and then converting messages retrieved from the queue back into objects or data that your application can process.
A Formatter object handles message serialization in the NGWS frameworks. You choose the appropriate type of formatter for the kind of data you want to send and receive. The NGWS frameworks ship four predefined formatters, each designed to persist and de-persist a different type of data:
In addition, you can create your own formatters if you need to work with different types of data. You can import your formatter into a project and access it in code.
You choose the formatter you want to use by setting the Formatter property for the queue or MessageQueue component with which you're working.
One advantage of the XML formatter is that you can read the strings that are created when the object or data is serialized. This means that if something happens and the message cannot be de-persisted from the message queue, you can take a look at the message itself and likely fix the problem.
Another advantage is that messages serialized with this formatter don't have to be de-serialized by the same formatter object. That is, you do not need to have the same formatter class in the receiver as you had in the sender, as long as both parties know the data schema. In addition, messages serialized by the XML formatter do not necessarily have to be de-serialized at all. Most browsers and other XML viewers can parse XML messages.
Creating MessageQueue Components | Sending and Serializing Messages | Serializing a DataSet into a Message