Bean-independent Properties
I just posted the first draft of a proposal for Bean-independent Properties for the Java language.This started when I was CC'd on email from Mikael Grev who prefers bean-attached properties. I prefer the opposite, so I figured I'd make my preference concrete. This is quite similar to an implementation by Remi Forax, who seems like a pretty damn smart guy from what I've seen so far.
What does it look like to use?
Customer customer = ...
String city = customer#city;
customer#city = "San Francisco";
And to declare?
public property Property<Customer,String> city
= new BasicPropertyBuilder(property(""))
.nonNull()
.observable(##propertyChangeSupport)
.build();
Read the Full Proposal.