Hi Jean-Baptiste,

Am 01.07.2009 um 14:33 schrieb Jean-Baptiste BRIAUD -- Novlog:

> On Jul 1, 2009, at 13:28 , Andreas Junghans wrote:
>> [CUT]
>> The serialization behaviour you need is quite different from what's
>> currently done (JavaBean-based vs. attribute-based). I don't think it
>> would be good idea to completely replace the existing approach.
>> Instead, the algorithm should be configurable so that users can  
>> choose
>> between JavaBean-based and attribute-based serialization (or plug in
>> their own custom code).
>
> Yes, I fully agree.
>
> Inspired from Hibernate, an annotation at class (bean) level may be  
> used to choose.

I'm not sure that's a good idea. IMHO the approach should be  
configurable on the RPC level, not (only) inside the classes that are  
serialized. After all, there may be cases where you want to use  
attribute-based serialization, but without a chance to modify the  
class in question (so you cannot add the necessary annotions).  
Instead, I think it should work something like this:

rpcLayer.setSerializer(new net.sf.qooxdoo.rpc.JavaBeanSerializer());

or

rpcLayer.setSerializer(new net.sf.qooxdoo.rpc.AttributeSerializer());

or

rpcLayer.setSerializer(new my.custom.Serializer());

Of course, the interface of the serializer classes would need to be  
specified first. Maybe Michael's branch already facilitates something  
like this?

> Currently, I'm no more trying to filter the map but to build it  
> since beanutils use the bean-based way. This is currently super  
> ineficient since the map is still calculated the bean-based way but  
> I don't care.
> First, I want to make it work and only after, I'll think about what  
> to improve.
>
> Here is what can be done with Hibernate as an analogy :
>
> @Entity
> @AccessType("field")
> public class MyBean { ... }

I'm fine with the annotation approach for controlling the details.  
However, the fundamental serialization algorithm should be  
configurable on a more global level. The annotations can then be used  
by the (de)serializer for fine-grained control. What do you think?

Regards,

   Andreas J.


------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to