On 2011-08-24 10:10, Marco Leise wrote:
Then I'll clearly use Orange when I have a need for serialization. Nice work!
Thanks.
I've taken a closer look at http://dsource.org/projects/orange/wiki/Features and I see that versioning is still missing. What are your plans there? What happens at the moment when I deserialize and object with missing/added fields?
I actually haven't tested that with the new implementation. The idea is to have a callback that is called when a field is missing, or something else goes wrong. Then you can handle it however you want, throw an exception, do nothing or something else. The default callback will throw an exception.
You can manually implement versioning by adding a new field to a class, an integer, string or similar, containing a version number. Then you can implement the two methods "toData" and "fromData". When deserializing you being with deserializing the field containing the version and then you can do whatever you want depending on the version number.
-- /Jacob Carlborg