Boris convinced me to keep the order of method calls similar to what you'd expect in regular nested method calls. e.g. if I want to observe person.getAddress().getStreet() the code should look like:

IValueProperty personAddressStreet = BeanPropertyBuilder.value(Person.class, “address”).value(Address.class, “street”).build();

or:

IValueProperty personAddressStreet = BeanPropertyBuilder.value(Person.class, “address”).value(“street”).build();

or even:

IValueProperty objectAddressStreet = BeanPropertyBuilder.value(“address”).value(“street”).build();

This latter example presumes support for generic bean properties (bug 247997). In this case the builder will try to infer the bean class from the value type / element type of the previous property. If the bean class can be inferred it is used; otherwise a generic bean property will be used.

This leads to interesting possibilities:

IListProperty friendsFathersFirstNames = BeanPropertyBuilder.list(Person.class, “friends”).value(“father”).value(“firstName”).build(); IObservableList friendsFathersFirstNamesObservable = PropertyObservables.observeList(person, friendsFathersFirstNames);