On 2009-12-07 23.30, philippe van dyck wrote:
No time for this, sorry.

I repatched SerializableType and everything work again.

For the record, (and my solution is far from perfect) in ToJSON in do:
<snip>

Alright, I have now patched SerializableType to do something similar, except instead of adding another layer to the object I just add "_type" as an extra field.

The ValueTypeSerializationTest has been updated with extra cases that tests this. Specifically:
        Property<Foo> foo();

        Property<FooValue> fooValue();

        Property<Foo> customFoo();

        Property<FooValue> customFooValue();
---
In the first case the serialization will be done by SerializableType, and _type will be included. In the second case serialization is done by ValueCompositeType (since the property type is a ValueComposite), and no _type is included. In the third case serialization is done by SerializableType and _type is included. In the fourth case serialization is done by ValueCompositeType and _type is included. The only way to not get _type to be included is hence to have a ValueComposite type as the type of the property, and let the instance be of that type. All other cases will include _type explicitly.

This should cover serialization quite well. The main issue I can see now is how we should handle migration, i.e. what if the types change name? We might want to be able to register such type changes somehow.

/Rickard


_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to