Glad to see progress on this. Ray, did anything come out of
discussions at Google I/O?

There seems to be two schools of thought here (both equally valid
approaches mind you):

1. Help the client participate in the persistence, maintain detached
state, dirty field lists, etc. This seems lofty and makes me more
concerned about tight coupling, but is probably exactly what is needed
for some applications.

2. Make a clean cut and keep the client free from persistence
concerns. This could be RPC with seperate DTOs or marshalled XML/JSON.
The client is only able to save by sending the modified object which
is then fully updated in the database (all fields, since we lost track
of what changed). This would typically happen by having the server
reconstruct the object (unmarshal), then merge this over an existing
entity.

Our app actually functions as #2. Currently we use GWT-generated XML
conversion code on the client. It's inefficient if your entity has
many fields and you change just one. We've employed "sparse xml" to
help, where we send back only the elements we want to modify (all of
them are optional). When this is applied to the entity, only one field
is triggered in the update. In theory this is great but I haven't
implemented to dirty field tracking in the client, so in practice we
serialize the whole object and we don't get any benefit from it.

So I guess I'm sort of sitting on fence on this one. I beleive #1 can
work, but I need to see proof of it in a large-ish app before we go
and touch anything.

On May 30, 4:24 pm, Piotr Jaroszyński <p.jaroszyn...@gmail.com> wrote:
> Hey Ray,
>
> > I've pretty much decided to go the DTO approach at this point as it is
> > known to work 100%. I don't feel the current hacks are production
> > worthy.
>
> You have mentioned on your blog that you use protobufs for DTOs. Could
> you please elaborate on that?
>
> P.S. Can't wait for gwt sessions to be uploaded on youtube!
>
> --
> Best Regards,
> Piotr Jaroszyński
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to