Le 8 déc. 2009 à 05:59, Rickard Öberg a écrit : > 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.
Actually the problem seems to come from a Property<Set<Value>> ... I don't know to what case it belongs. > > 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. Indeed, saving the actual fqdn is not a good idea. I read previously on the list (I think it came from you) about the whole idea of "loading" an untyped entry stored (in an ES) "into" a composite, and I find it very elegant. Having a type-agnostic store looks definitely more efficient when you think about maintenance (i.e. migration), but I did not find any other way to solve this. Why does it happen in the first place ? Should we store some kind of type registry ? (sounds like a very bad idea) BTW, do you plan to create an "ArraySerialization" to store arrays (or sets) of properties the JSON way ? Thanks again for your help. phil > > /Rickard > > > _______________________________________________ > qi4j-dev mailing list > [email protected] > http://lists.ops4j.org/mailman/listinfo/qi4j-dev _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

