So I am really annoyed that Java doesn't support C# like properties. I tried a lot of things to emulate that behavior and this is the best I came up with:import javafx.beans.property.*;//immutable class (ReadOnlyProperties are ugly to create)class Person {    public final ReadOnlyStringProperty name;    private final ReadOnlyIntegerWrapper ageWrapper = new ReadOnlyIntegerWrapper(0);    public final ReadOnlyIntegerProperty age = ageWrapper.getReadOnlyProperty();    public Person(String name) {        this.name = new ReadOnlyStringWrapper(name).getReadOnlyProperty();    }}//mutable class with field that overrides a setter (really concise)class Squarer {    public final DoubleProperty somethingSquared = new SimpleDoubleProperty() {        public void set(double value) { super.set(value * value); }    };}public class Main {    public static void main(String[] args) {        Person p = new Person(Peter);        System.out.println(p.name.get()); // Peter        System.out.println(p.age.get());  // 0        Squarer s = new Squarer();        s.somethingSquared.set(5);        System.out.println(s.somethingSquared.get()); // 25.0    }}I am using JavaFX Properties to box in all instance fields. All properties are public final  so that they are immutable and you can access them with someProperty.get() instead of getSomeProperty().If you want to have a custom getter/setter you just can override them anonymously like I did above. This has the advantage that the implementation is close to the property at all times.A nice side effect is that you can always bind properties. For example you could bind the age property to a Calendar and have its age updated accordingly.I really like that approach, because you don't have to write getters and setters which fill up your class just in case you want to change the implementation at some point.I already used it in my personal projects with great success and am playing with the thought to use it in real projects at work, but before I do that I want to be sure that there are no downsides to it.Do you see any downsides (other than performance)?I would love that to be the new standard at work.
Are there any downsides to JavaFX Properties as a replacement for Beans?
java;properties