I took a slightly different approach to option 1.

I created a interfaces that describe the Animal and made both the DTO
and GWT implement the interfaces.  This lets me control the
dependencies and ended up cutting down on the amount data I needed to
send to the browser.  I'm actually referring to a scheduling
application but to keep the Animal analogy I found that the majority
of components only needed to know the animal's species and age, not
every detail that was in the object.

On Jun 29, 12:34 am, Dalla <[email protected]> wrote:
> You would have to do it either like you suggested; create two separate
> classes,
> one "persistence" class, and then one DTO class.
>
> Or you could create just a POJO and keep the persistence info in a
> separate mapping file.
>
> From what I understand, most tend to go with the first option.
>
> On 28 Juni, 14:09, Ben Daniel <[email protected]> wrote:
>
> > Let's say I want to persist Animal objects using JDO and also want to
> > return these Animal objects via a GWT RPC service. From what I
> > understand GWT will compile a version of Animal in javascript on the
> > client. And I take it that any JDO persistence stuff shouldn't be
> > going down to the client.
>
> > So do I have to create two separate classes for my Animal type: one
> > used on the server for persistence via JDO and another which the
> > client uses over RPC. Is this the normal thing to do?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
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