On Mon, 14 Sep 2026 12:13:05 GMT, Kevin Rushforth <[email protected]> wrote:

> > > * within each group (invalidation, change), the listeners are called in 
> > > the order they were registered
> > 
> > Same as above; we could specify this as changing it now or later is likely 
> > to subtly break existing applications. In this case it also aligns with the 
> > veto behavior which would be hard to do if these lists were unordered.
> 
> Yes, I like the idea of specifying both of the above, since, as you say, many 
> applications would break if either of these changed.

If we specify the invocation order, we should be careful what exactly we're 
specifying. For example, since it's become really easy to use flat-mapped 
property chains, I've been thinking that it might be an idea worth exploring to 
optimize some use cases. Since many property chains have a common prefix, this 
could be a control subscribing to something like 
`sceneProperty().flatMap(Scene::windowProperty).flatMap(Window::opacityProperty)`.

It's generally not a good idea to add a large number of listeners to a 
property, especially if the number of listeners fluctuates, as they're not 
optimized for it. With the scenario of a flat-mapped binding with a common 
prefix, this could be more efficiently implemented by a single listener on the 
prefix properties, and an internal fan-out-mechanism (for example, using a 
`Set`).

The question is if an ordering specification would also apply through mapped 
bindings, which would constrain some of the potential future design space.

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1081#issuecomment-5664865980

Reply via email to