3 ms·
Yes, the single threaded design is the way to go. The authors elaborated their position on it and understandably came to the conclusion that multi-threaded upda
by ysleepy 10y ago
Yes, the single threaded design is the way to go. The authors elaborated their position on it and understandably came to the conclusion that multi-threaded updating support will just explode the complexity. But since they obviously thought about this Problem, I don't understand why this issue does not get more attention API wise.
There is the javafx.concurrent package, but that just gives you the low-level stuff Tasks/Futures. But what I really want is property binding ( or something more declarative than manually hooking Task-lambdas everywhere ) between the backend threads (which are mandatory since you don't compute in the UI thread) and the UI. You end up duplicating your models because this is really hard otherwise, even though you might only have a viewing App with little logic and could just use the JavaFX Observables as your model properties. Then you have 2 models (MVVM yay) which need to be synchronized, and right now its just loads of Platform.runLater wrapped lambdas everywhere.
So the platform kind of forces the MVVM thing, but does not give you much support of doing it in an idiomatic or clean way.
I dont really have a good solution for this either, I think DataFX goes there but I have not tried it.
But this is all really criticism on a rather high level. I did some cocoa stuff, and my hair fell out. Id rather wrangle JavaFX than cocoa any day.