-
Notifications
You must be signed in to change notification settings - Fork 3
Comparison with protobuf net and migration
In short, protobuf-net serializes data but AqlaSerializer is intended to serialize objects. What the difference? Data serializers don't care much about language runtime specifics like references, inheritance, etc. In contrast, an object serializer should take such things into account.
Are you tired of endless ProtoExceptions like Internal error; a key mismatch occurred
? Think AqlaSerializer is a solution.
For Aqla and third party attributes reference tracking and null support are enabled by default where appropriate.
- Nested collections are supported.
- Always packed for better output size.
- Empty array is not the same as null and vice versa.
- Possible versioning between arrays and lists.
- For collections subtype information is written.
- Settings can be specified separately per collection member and nested value.
To allow users reference both protobuf-net dll and AqlaSerializer I introduced new attributes in AqlaSerializer namespace. I want to make the migration as much easy as I can so AqlaSerializer supports all the protobuf-net legacy attributes. You don't need to remove protobuf-net reference and can use both AqlaSerializer and protobuf-net in the same project. Legacy attributes are supported when you reference protobuf-net.dll.
AqlaSerializer.dll | protobuf-net.dll |
---|---|
SerializableType | ProtoContract |
SerializeDerivedType | ProtoInclude |
(Partial)SerializableMember | Proto(Partial)Member |
(Partial)NonSerializableMember | Proto(Partial)Ignore |
(Before|After)(Des|S)erializationCallback | Proto(Before|After)(Des|S)erialization |
SurrogateConverter | ProtoConverter |
BinarySerializationBehavior | ProtoBehavior |
Attributes behavior is controlled by a current auto-add behavior.
AqlaSerializer new attributes have improved behavior which you need to take into account when migrating: SerializableType
assumes ImplicitFields
behavior by default which means all properties of type are considered serializable automatically (even with no explicit SerializableMember
attribute). You can change this with SerializableType.ImplicitFields
property.
The legacy attributes are not affected by this.
And there are more ImplicitFields
options are available now.
As AqlaSerializer is basically a fork of protobuf-net, it's checked against the same tests. The behavior should be nearly the same for legacy attributes as it passes practically all protobuf-net tests which are not related to its write format.
Be aware that you can't directly serialize objects with protobuf-net and than deserialize them with AqlaSerializer and opposite unless you use a compatibility mode.
See also Protocol Buffers support page.
Everything is the same as in protobuf-net but support for CF 2, CF 3.5, Windows Phone 7 and .NET 1.1 has been dropped.
vdproj installation project has been removed.