I'm looking for a Serializer to persist my classes in text format (not binary). But...
I'm already using protobuf for binary serialization. It works pretty fine. As a side note, I would have prefer not to deal with field id (index) like with protobuf.
Before closing or voting to close this question, please consider these points:
- The specificity of this question
- If other question really apply to my requirements and are not too old
I'm looking for a serializer with the following properties:
- Easy to use
- Serialize in text (readable) either Json or XML would be fine
- Free
- Is documented
- Support versioning easily (obsolete field, type change, property name change, ...)
- Uses Attribute to define items to serialize (or not serialize)
- Does not uses an index (ID like Protobuf)
- Be able like Protobuf, to deserialize an object directly without any constructor. Be able to instanciate an object either if the object does not have any public constructor and does not have any constructor with no arguments.
- Does not require me to change my class or member accessibility, ie:
- Does not need default constructor
- Can serialize fields
- Can skip public property (when marked to do so)
Others points not essential:
- The speed is not important
- Open source is a nice bonus
- Has some examples is a nice bonus
Some examples of what I prefer to not use:
- Microsoft XMLSerializer and JsonSerializer does require default constructor.
- I have hard time using Microsoft-DataContractSerializer, an easier solution would be welcome.