While I agree that RequestFactory is the ultimate solution, we don't always 
have the luxury of selecting which server to communicate with .. I am bound 
to using JSON-RPC as our server end is in .NET ..

I faced the same polymorphism solution, and solved it by creating a "mondo" 
interface .. I created one interface that extends all subclasses of the 
base type ..

Our process is somewhat convoluted ... using soap to import all possible 
models, params, and results .. Then running a script to sanitize the data 
and create autobean compatible interfaces out of this data..

My issue was serializing one param that was a generic filter .. creating 
this mondo interface lets me set only the values I want yet allows for 
every field I've set to be serialized..

cheers

On Friday, 3 June 2011 14:55:39 UTC-4, Derek wrote:
>
> Thanks for posting this, Panam. I was just starting to consider using 
> AutoBean with LocalStorage, since storing a JSON string seems like the 
> best solution than rolling my own custom serializer. I haven't gotten 
> too far into it beyond some simple test cases. 
>
> For 2), I seem to recall seeing that polymorphism for AutoBean is an 
> eventual goal for the GWT group, but 2.3 doesn't support it. 
>
> For 1), my thoughts would either be on using AutoBeanVisitor (which 
> can only see things already explicitly added, so probably not) or a 
> generator (which might trip up AutoBean's generator), but I haven't 
> tried either in the way you describe, so maybe I'm wrong. 
>
> I think the official way is to have an interface for each subclass in 
> your AutoBeanFactory, so for example: 
>
> public interface Base { 
>   getName() / setName() 
> } 
>
> public class BaseImpl implements Base { ... } 
>
> public interface Color extends Base { 
>   getColor() / setColor() 
> } 
>
> public class ColorImpl extends BaseImpl implements Color { ... } 
>
> public interface Serializer extends AutoBeanFactory { 
>   AutoBean<Base> wrap(Base wrap); 
>   AutoBean<Color> wrap(Color wrap); 
> } 
>
> That works if you only have a small handful of subclasses, but it gets 
> progressively worse the more you add. 
>
> On Jun 2, 3:48 am, Panam <[email protected]> wrote: 
> > Hm, I am just looking for a way to enocde and persist (webstore) state 
> > (some POJO properties) on the client. 
> > I have difficulties to see see how the RequestFactory will help me 
> > here as my intention is that it is for client server communication. 
> > However, it ought to be possible (at least, it has to do serialization 
> > to put the data on the wire). 
> > As I understand autobeans, they are that part of the bindery framework 
> > that is used for this purpose (amongst all by the request factory 
> > itself). That's why I am trying to use them here. 
> > 
> > Regards, 
> > panam

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/2xL-2JthgdQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to