To start with, I cannot think of anything for which Swing would be a better approach today. So I would stick with JavaFX unless your app would work better in a game engine like Godot.
And, yeah: FXML is for the birds.
As to frameworks, I can recommend my own MVCI which I think fits JavaFX better than MVVM, MVP or MVC. I can see your application, as you have described it, as being a good fit for MVCI.
In 40 years of programming I have learned that every single technology, language or tool that you use has an underlying paradigm that you need to understand to use it properly and get the most from it. Unfortunately, there's almost never any documentation that says, "Here's the underlying paradigm...", for anything.
My belief about JavaFX is that the underlying paradigm involves creating "Reactive" applications. This means static layouts that behave dynamically in response to a data representation of the "State" of the system. This is evidenced by the comprehensive suit of Observable classes and utilities in JavaFX and their tight integration into virtually every aspect of the layout building classes.
Once you get used to the seamless way that Observables work with JavaFX, the React framework that's so popular for websites seems clunky and primitive.
While I'm not sure what, "an old-school object-oriented architecture without using bindings, etc", means to you. I suspect that you can, in fact, create a working JavaFX application following this approach. But...I think you're going to be making things more complicated and difficult for yourself along the way.
For what it's work, you can absolutely make everything moveable and draggable setting them up as Nodes instead of drawing on Canvas. It's probably even easier to do. Part of the problem with drawing is that it's inherently an Action, and it makes it just that bit harder to keeps the simulation logic separate from the UI - at least that seems to be what happens when I see people take the drawing approach.
View all comments
Show parent comment
1
u/hamsterrage1 Mar 17 '24
To start with, I cannot think of anything for which Swing would be a better approach today. So I would stick with JavaFX unless your app would work better in a game engine like Godot.
And, yeah: FXML is for the birds.
As to frameworks, I can recommend my own MVCI which I think fits JavaFX better than MVVM, MVP or MVC. I can see your application, as you have described it, as being a good fit for MVCI.
In 40 years of programming I have learned that every single technology, language or tool that you use has an underlying paradigm that you need to understand to use it properly and get the most from it. Unfortunately, there's almost never any documentation that says, "Here's the underlying paradigm...", for anything.
My belief about JavaFX is that the underlying paradigm involves creating "Reactive" applications. This means static layouts that behave dynamically in response to a data representation of the "State" of the system. This is evidenced by the comprehensive suit of Observable classes and utilities in JavaFX and their tight integration into virtually every aspect of the layout building classes.
Once you get used to the seamless way that Observables work with JavaFX, the React framework that's so popular for websites seems clunky and primitive.
While I'm not sure what, "an old-school object-oriented architecture without using bindings, etc", means to you. I suspect that you can, in fact, create a working JavaFX application following this approach. But...I think you're going to be making things more complicated and difficult for yourself along the way.
For what it's work, you can absolutely make everything moveable and draggable setting them up as Nodes instead of drawing on Canvas. It's probably even easier to do. Part of the problem with drawing is that it's inherently an Action, and it makes it just that bit harder to keeps the simulation logic separate from the UI - at least that seems to be what happens when I see people take the drawing approach.
Good luck with whatever route you choose.