Sending persisted JDO instances over GWT-RPC

Posted by Ben Daniel on Stack Overflow See other posts from Stack Overflow or by Ben Daniel
Published on 2009-06-28T23:13:28Z Indexed on 2010/05/06 23:58 UTC
Read the original article Hit count: 600

Filed under:
|
|

I've just started learning Google Web Toolkit and finished writing the Stock Watcher tutorial app.

Is my thinking correct that if one wants to persist a business object (like a Stock) using JDO and send it back and forth to/from the client over RPC then one has to create two separate classes for that object: One with the JDO annotations for persisting it on the server and another which is serialisable and used over RPC?

I notice the Stock Watcher has separate classes and I can theorise why:

  • Otherwise the gwt compiler would try to generate javascript for everything the persisted class referenced like JDO and com.google.blah.users.User, etc
  • Also there may be logic on the server-side class which doesn't apply to the client and vice-versa.

I just want to make sure I'm understanding this correctly. I don't want to have to create two versions of all my business object classes which I want to use over RPC if I don't have to.

© Stack Overflow or respective owner

Related posts about gwt

Related posts about gwt-rpc