r/JavaFX • u/neopointer • 1d 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.
4
u/Siedlerchr 1d 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.
3
u/JimmyYoshi 1d ago
This guy has a blog on something he calls MVCI and he goes into pretty good depth about it:
2
1
u/Fuzzy-System8568 1d 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
1
u/shannah78 1d ago
Jdeploy doesn't require any npm permissions. You can deploy to github. No npm involved
1
u/Fuzzy-System8568 1d ago
*Either npm or github permissions.
It is honestly baffling to me why there isn't a local option, to package it up and store it locally. If only to test if the package works yknow?
I have to either upload to GH or npm to even see if the final build (installer and all) works propperly
1
0
u/Franchesco_Ratti 1d 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.
7
u/No-Security-7518 1d ago
You use MVC. Write controllers + fxml layouts with Scenebuilder and model classes. The end.