From what I understand, you are "manually" copying the properties from
the Entity to the DTO. But this process is automated in GWT 2.1
So, I am not sending my entities directly, but the proxies as per the
documentation : http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html
"An entity proxy is a client-side representation of an entity,
otherwise known as a DTO (Data Transfer Object). With RequestFactory,
entity proxies are interfaces that extend the EntityProxy interface,
which is the hook used to indicate that an object can be managed by
RequestFactory. RequestFactory automatically populates bean-style
properties between entities on the server and the corresponding
EntityProxy on the client, which simplifies using the DTO pattern.
Furthermore, the EntityProxy interface enables RequestFactory to
compute and send only changes ("deltas") to the server."
"Entity proxies simply extend the EntityProxy interface and use the
@ProxyFor annotation to reference the server-side entity being
represented. It is not necessary to represent every property and
method from the server-side entity in the EntityProxy, only getters
and setters for properties that should be exposed to the client."
The entity proxies are merely interfaces that are being populated by
the new GWT 2.1 RequestFactory framework. I have no control over this
copying process. Per definition, getters/setters of the real entity
are injected into the EntityProxy whenever they are present;
So my problem still stands : what about complex values like
com.google.appengine.api.datastore.Email that are not known by the
client side code ? How to transfer these complex values to the client.
AppEngine JDO example #1: retrieve an object by ID « TurboManage - 0 views
DTO object - Google App Engine for Java | Google Groups - 0 views
-
-
When I copy my entities onto my dtos, some entity fields don't even make it into the dto. Others only have getters in the dto because they are read-only to the client. Those that do get into the dto get converted to native Java types. For instance, Text gets converted to String. Key gets encoded to a url friendly string. If I have Set fields on the entities to manager my relations (property lists), I remap those to ArrayList... First, don't serialize interfaces to GWT client, you'll get Javascript bloat. Then, Hashmap is costly to serialize because String.hashCode() is not the same on in Java and in Javascript. Hence, all the items need to be re-inserted into a client side map. Of course, in Web mode, performance is good enough... but in development mode, your data transfers will become really slow for somewhat big transfers.
GAE Datastore: read (no transaction) - 0 views
« First
‹ Previous
221 - 232 of 232
Showing 20▼ items per page