On Sat, Jun 18, 2011 at 12:44 PM, Rickard Öberg <[email protected]> wrote: > I'm removing EntityType, PropertyType, AssociationType and > ManyAssociationType. Whatever methods in there that were required by code in > libraries/extensions are moved to EntityDescriptor, PropertyDescriptor, > AssociationDescriptor and ManyAssociationDescriptor. This is so that we > don't have multiple type/descriptor SPI classes. The only remaining one, for > now, is ValueType, which seems to be necessary to have there as sometimes it > maps to a ValueComposite and sometimes to something simpler as String. When > it's a ValueComposite that model will be the backing implementation of > ValueType, however.
+1 > As I go through the code I'm also noticing that the decision to have > fromJSON and toJSON in the main framework is not exactly optimal. Apart from > always using the same JSON framework (which we now know is not the most > optimal), there are some options needed at times for the serialization, such > as whether to include type information or not. I'm strongly considering > moving the fromJSON/toJSON to a separate serializer/deserializer service, so > that these things can be more easily configured. By doing so it would also > make it easier to create alternative serializers, such as RDF and XML. > > This *could* mean a breaking change in Value, since it has toJSON(), and > ValueBuilderFactory since it has fromJSON(), but one option is to > instantiate a default serializer for those purposes, so that the API doesn't > change. I think that the toXyz() on value should use the I/O style DSL. Not in mood to look at details, but a value.format(json()).to( stream(System.out) ); style thing would probably look neat. Keeping toJSON() is probably necessary. Cheers -- Niclas Hedhman, Software Developer http://www.qi4j.org - New Energy for Java I live here; http://tinyurl.com/3xugrbk I work here; http://tinyurl.com/24svnvk I relax here; http://tinyurl.com/2cgsug _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

