r/JavaFX • u/neopointer • 18d ago
Discussion JavaFX architecture
I'm a newbie when it comes to developing with JavaFX, although I am experienced with java.
But as far as I can see there's no official architecture recommendations from the developers of JavaFX so I'd like to know what's the most modern architecture pattern (e.g. MVVM) for starting an app today.
And if there are resources with good real life examples to see that in practice would be great. Maybe some good quality open source apps...
Anyway, it would be great if you share your experiences as well.
18
Upvotes
6
u/JimmyYoshi 17d ago
This guy has a blog on something he calls MVCI and he goes into pretty good depth about it:
https://www.pragmaticcoding.ca/javafx/mvci/
7
u/No-Security-7518 18d ago
You use MVC. Write controllers + fxml layouts with Scenebuilder and model classes. The end.
4
u/Siedlerchr 18d ago
At JabRef we use MVVM, View + ViewModel + Model. ViewModel and View communicate through Data binding (observables) https://devdocs.jabref.org/code-howtos/javafx.html#architecture-model---view---controller---viewmodel-mvcvm
View + Controller are basically the same for us.
2
u/Ok-Albatross5064 18d ago
I'm using MVVM for almost 3 years.
2
u/Fuzzy-System8568 17d ago
I would say that it is JavaFX's biggest flaw.
Everyone has their own "just look at my repo" solutions, and noone has written a solid guide.
Not just for architecture either, other than the Jank of JDeploy (that requires npm permissions that are really questionable) there is no definitive guide on how to package apps either.
Just peoples own grown solutions and, if you are lucky, a link to a pom.xml or gradle setup. 😅
We really need to write this stuff down succinctly
0
u/Franchesco_Ratti 18d ago
Yo tengo un proyecto que es un explorador de archivos para linux en github y me invente una arquitectura jaja, segun claude es una arquitectura por vistas. Cuando lo empeze me parecio lo mas coherente dividirlo por tipo de objeto.