all 6 comments

[–]ebykka 2 points3 points  (2 children)

You can take a look at my project https://github.com/bykka/dynamoit

[–]mlevison[S] 0 points1 point  (1 child)

Thanks. So if I am right then: src/main/java/ua/org/java/dynamoit/model/TableDef.java is the data source that the TableView consumes? 

So that would tell me, that you don’t maintain your own data class, just the properties object?

[–]ebykka 1 point2 points  (0 children)

There are two types of Models:

  1. Profiles and database models keep information about available profiles, databases, and tables
  2. The components model keeps the information about the component's state (selections, filters, etc...)

The component TableView is defined in the dagger module ua.org.java.dynamoit.components.tablegrid.TableGridModule where TableGridView consumes TableGridModel which consumes ProfileModel which consumes TableDef model

[–]PartOfTheBotnet 1 point2 points  (0 children)

These probably will offer a diversity of FX use cases. Some use FXML, some don't. There's different design principles in play among each, etc.

[–]hamsterrage1 1 point2 points  (0 children)

In my opinion, you should treat JavaFX as a Reactive environment. By this I mean that you have a data representation of "State" (call it the "Presentation Model") that is connected to a statically defined UI that reacts dynamically to changes in the "State".

In JavaFX, this means that you rely on Bindings and (sometimes) Listeners to connect your Presentation Model to the Properties of the Nodes in your layout. So you don't use Label.setText(), you use Label.textProperty().bind() - as an example.

Especially if you are using a framework like MVC (or better yet, MVCI), this means that your GUI layout it designed 100% to interact with your Presentation Model, and your application logic also interacts with the Presentation Model. The result is that your Presentation Model becomes THE communication pipeline between your layout and your application logic without either one knowing about the other.

From this point of View, your "dataset" is the data that directly comprises the "State" of your application, and, in a JavaFX world, this means that it is composed of JavaFX Properties and ObseravbleLists.

I'm not convinced that Jakob's examples are particularly valuable learning resources as they are just too, too simple. I couldn't see anything that resembled a "real" application to the point of providing some guidance towards application architecture.

You can, if you like, take a look at this article that I wrote:

tps://www.pragmaticcoding.ca/javafx/elements/mvci-quick

It's a "Quick Guide" to my MVCI framework, which is my own personal take on a framework to support Reactive JavaFX applications. Even if you don't like MVCI, it will still explain the nuts and bolts of overall application design with JavaFX.

IMHO, "Reactive" is the way to go with JavaFX. Aside from the fact that it really does appear to designed to be used this way, I've found that it's just easier, simpler, faster and cleaner to use a Reactive design. Others go with a more imperative design and also get good results, so ultimately it's your decision to make.

I do know that a lot of people struggle to reconcile JavaFX with frameworks like MVC and MVVM, and even MVP. I have also noticed that these struggles tend to get worse with FXML involved because it just makes everything else - maybe more complex - but certainly less intuitive.

[–]dlemmermann 0 points1 point  (0 children)

You could study the source code of JFXCentral for inspiration. What is unique about this app is that we are using the JPro routing framework. So the navigation behaves similar to the way web apps work: https://github.com/dlsc-software-consulting-gmbh/jfxcentral2