How to trigger property invalidation?
Werner Lehmann
lehmann at media-interactive.de
Mon Nov 5 02:57:34 PST 2012
Hi Pavel,
On 05.11.2012 09:46, Pavel Safrata wrote:
> I understand your concern, I've come across a similar issue some time
> ago. Your approach looks technically nice but conceptually is not so
> nice because the property refers to an employee, and even if the
> employee moved to a different address, it's still the same employee.
> Admitting it doesn't look so neat, here is the approach we've chosen:
thanks. It is true, editing the employee does not make it a different
employee. That's exactly why I'd prefer to invalidate the property
without replacing the employee instance ;-)
I realize that making everything observable would solve this problem -
while creating a new one: server provides a POJO, and for GUI I'd have
to copy the data to an "FX-Employee" bean. And that's exactly one of the
topics in this other property thread on the list (blackmagic (I like
that), property paths, etc).
Personally I don't want to create those FX observable beans shadowing
the domain beans to get observability. The data of a single employee
would go from the database to a Hibernate bean to a domain bean to an FX
bean and back. That's a lot of copying and boilerplate.
But I also realize that there is no easy way to have both. It seems easy
enough to make markInvalid protected but even then I'd have to find a
workaround for 2.2.x.
Rgds
Werner
More information about the openjfx-dev
mailing list