Revision: 9166
Author: b...@google.com
Date: Fri Oct 29 11:32:27 2010
Log: Created wiki page through web user interface.
http://code.google.com/p/google-web-toolkit/source/detail?r=9166

Added:
 /wiki/AutoBean.wiki

=======================================
--- /dev/null
+++ /wiki/AutoBean.wiki Fri Oct 29 11:32:27 2010
@@ -0,0 +1,87 @@
+#summary Structure, not boilerplate
+
+= GWT !AutoBean framework =
+
+The AutoBean framework provides automatically-generated implementations of bean-like interfaces. AutoBeans can be used in both client and server code, to improve code re-use. This document describes the state of AutoBeans as found in the GWT 2.1.1 release.
+
+<wiki:toc />
+
+== Goals ==
+
+  * Decrease boilerplate in model-rich applications
+  * Support easy encoding of AutoBeans to JSON structures
+  * Provide support code for common operations on data-model objects
+  * Usable in non-GWT code
+
+== Non-goals ==
+
+  * Support for non-DAG datastructures
+  * Support for object identity semantics
+
+The non-goals for AutoBeans are key features of the RequestFactory framework. If higher-order data-model semantics are required,
+
+== Quickstart ==
+
+{{{
+// Declare any bean-like interface with matching getters and setters, no base type is necessary
+interface Person {
+  Address getAddress();
+  String getName();
+  void setName(String name):
+  void setAddress(Address a);
+}
+
+interface Address {
+  // Other properties, as above
+}
+
+// Declare the factory type
+interface MyFactory extends AutoBeanFactory {
+  AutoBean<Address> address();
+  AutoBean<Person> person();
+}
+
+class DoSomething() {
+  Person makePerson() {
+    // Instantiate the factory
+    MyFactory factory = GWT.create(MyFactory.class);
+    // In non-GWT code, use AutoBeanFactoryMagic.create(MyFactory.class);
+
+    // Construct the AutoBean
+    AutoBean<Person> person = factory.person();
+
+    // Return the Person interface shim
+    return person.as();
+  }
+
+  String serializeToJson(Person person) {
+    // Retrieve the AutoBean controller
+    AutoBean<Person> bean = AutoBeanUtils.getAutoBean(person);
+
+    return AutoBeanCodex.encodeForJsonPayload(bean);
+  }
+}
+}}}
+
+== Property types ==
+
+The following types may be used to compose AutoBean interfaces:
+  * Primitive types and their boxed counterparts
+  * `BigInteger`, `BigDecimal`
+  * `java.util.Date`
+  * enum types
+  * Strings
+  * Bean-like interfaces
+  * Lists or Sets of any supported property type
+
+== !AutoBean ==
+
+
+
+== !AutoBeanFactory ==
+
+== !AutoBeanCodex ==
+
+== JSON structures ==
+
+== FAQ ==

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

Reply via email to