Declarative derived properties for mutable models in Java

Is there an environment for synchronizing POJO properties? For example, I want to express (in some high-level declarative form) that, foo.text = bar.text + baz.textor foo.y = (max(bars, y)).ywithout the need to register a change in a property, an element adds and removes listeners on values ​​and (especially) collections that repeat and -prone errors.

+3
source share
1 answer

javafx and the binding operator , For example:

var x = 10;
var y = bind -x + 100;
assert y == 90;        // passes
y = 40;                // bind! 
assert x == 60;        // passes

for java take a look at JSR 295

+2
source

Source: https://habr.com/ru/post/1706633/


All Articles