Revision: 9198
Author: [email protected]
Date: Mon Nov  8 10:58:24 2010
Log: Edited wiki page RequestFactory_2_1_1 through web user interface.
http://code.google.com/p/google-web-toolkit/source/detail?r=9198

Modified:
 /wiki/RequestFactory_2_1_1.wiki

=======================================
--- /wiki/RequestFactory_2_1_1.wiki     Fri Nov  5 08:29:10 2010
+++ /wiki/RequestFactory_2_1_1.wiki     Mon Nov  8 10:58:24 2010
@@ -18,13 +18,20 @@

 Stuff not yet published:
   * (Issue 5522, issue 5357) Value types / Embedded objects
- * Value types are EntityProxies that have a `...@proxyfor(isValueType=true)` annotation. This will relax the requirement that the domain entity type has a getId() and getVersion() method. - * All instances of EntityProxy must be addressable. An EntityProxy is addressable if:
-      * It has a getId().
- * The `...@proxyfor` annotation or enclosing RequestFactory specifies a `Locator` - * A chain of getter calls can be constructed to the object from an addressable object - * The entity is contained within an addressable Collection (i.e. a List) - * Sets are non-addressable because they have no means of addressing a particular element within the set, nor can the iteration order be depended upon. + * A user-defined value object must extend the empty ValueProxy interface and declare a @ProxyFor annotation. + * This intentionally prevents the VP from being passed into RequestContext.edit(): + * ValueProxy instances are never sparse and will implement equals() and hashCode() based on the values in the proxy. + * The VP will include the ids for any referenced EntityProxy fields, but will not force data for the referenced EP's to be returned unless there's a with() clause in play. + * A ValueProxy returned from an immutable EntityProxy is immutable. The EntityProxy must be placed into an editable mode via the usual RequestContext.edit() before you can make a call like entityProxy.getValue().setFoo("bar"). + * A VP returned from a service method invocation is mutable, since mutating it wouldn't be expected to alter the state of any EntityProxy. + * The sometimes-mutable nature of a VP is slightly confusing, but it can be resolved by asking: Did I get the ValueProxy from a getter or an onSuccess()? + * A new "Proxy" interface will be added as a superclass of ValueProxy and EntityProxy to allow `RequestFactory.create` to operate on both value and entity types. + * Because ValueProxy doesn't have a stableId() method, there's no way to use a VP with a call to find() or with any other service method that has an EntityProxyId argument. + * If you think about a Date object, there's no real meaning in giving a Date an id. + * If an EntityProxy has a value property, all of the properties of the VP are checked for mutations and sent to the server. + * The value in the domain object will be replaced if anything in the VP's state has changed. + * If you don't want the destructive operation, don't use value objects, or use the to-be-written service helper / Locator to cook up your own id scheme. + * Since we currently support Date (and it is mutable) the RF client-side code will use a subclass of Date that can be frozen to ensure that the owning EntityProxy must be edited. * (Issue 5111) Extracting a `ServiceHelper` for `ReflectiveServiceLayer` for a simple API to interface with existing systems * This should include support for bulk operations API in `ReflectiveServiceLayer` to allow query plan optimization * A `Locator` can be specified for entire RequestFactory declarations as well as individual proxy types

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to