ogallagher / fxgraph

A JavaFX graph editor
Do What The F*ck You Want To Public License
2 stars 0 forks source link

Return ReadOnlyDoubleProperty from property getters #4

Open ogallagher opened 3 years ago

ogallagher commented 3 years ago

Given there are also methods to set and get the values of these properties, and the properties themselves are private members, I think it makes sense to wrap these properties in read-only classes when returning them from getter methods.

Examples:

In cases where the property should be write-accessible, then the property scope could be public instead of private, though I suppose that does open the member up to reassignment and loss of bindings.