tobiasdiez / EasyBind

Custom JavaFX bindings made easy with lambdas.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add stream interface for observable lists

tobiasdiez opened this issue · comments

Idea: Have an interface that works similar to List.stream() but takes updates into account.

Similar implementation: https://github.com/griffon/griffon/blob/development/subprojects/griffon-javafx/src/main/java/griffon/javafx/collections/ObservableStream.java

Is this something that requires some planning and careful implementation according to an interface? Or can we simply go ahead and add convenience methods to EasyObservableList inspired by this? (I'd really like EasyObservableList#map)

New convenient helper methods are always happily seen!

A proper stream-like interface is more work as one has to worry about chaining different operations. For the best performance, you don't want to create an intermediate list, and then listen to change events to this list; but you would like to listen to events of the original source and then transverse the stream-chain to only update the resulting list.

Ah, I see. So the difficulty does not lie in the API design, but in an efficient implementation. Thus, the methods can already be added with a naive implementation, and optimized afterwards?

Yes, exactly!