Hi,
I have just stumbled over Bindgen [1] and its GWT version [2]. The
library generates from class Foo, say, a class FooBinding that allows
you to access the properties of Foo with set() and get(). (It does not
implement any Observer pattern as the name might suggest.)
Have there been any thoughts of using such a tool to make bindings
like:
public static abstract class PersonModelProvider extends
BeanModelProvider<Person>{}
private PersonModelProvider personProvider =
GWT.create(PersonModelProvider.class);
...
givenName = fieldOfType(String.class).boundTo(personProvider,
"givenName");
surname = fieldOfType(String.class).boundTo(personProvider,
"address.street");
type-safe as in the following pseudo-code?
givenName = fieldOfType(String.class).boundTo(new
PersonBinding().givenName());
surname = fieldOfType(String.class).boundTo(new
PersonBinding().address.street());
Type-safety will ensure at compile time that all you model paths are
correct – a powerful feature.
Kaspar
[1]
http://bindgen.org/
[2]
http://github.com/stephenh/bindgen-gwt/