-
Notifications
You must be signed in to change notification settings - Fork 26
Serialization
Hagen Siegel edited this page Apr 21, 2021
·
4 revisions
Objects cannot be sent over the network as they are. They need to be serialized into a byte array in order to be transferred. After received, the byte array must be deserialized into an object again. CoreRemoting does all this serialization work for you automatically.
To make our life more exciting, there are different ways to serialize C# objects. And each of these different ways has advantages and disadvantages. The serializers, that implement that different ways of serialization, are not hard coded into CoreRemoting. Serializers are integrated via an adapter component instead. Such an adapter must implement the ISerializerAdapter interface.
CoreRemoting supports the following serializers out of the box:
Serializer | Description | Serializer adapter class |
---|---|---|
BSON (with JSON.NET) | Serializes almost every type into a Binary JSON stream | BsonSerializerAdapter |
BinaryFormatter | Serializes types that are marked [Serializable] or implement ISerializable interface into a byte stream | BinarySerializerAdapter |