Javafx: pros and cons of MVC, MVP, MVVM, etc

Asked

Viewed 182 times

3

Which Model-View (MV) standard to use with Javafx thinking of scalability and good maintainability?

On Google you find people recommending MVC, MVP, MVVM... maybe there are others.

Some say that Javafx was made to use with MVC. Others admit that there are many possible variations but prefer MVP to MVC, although this seems more natural. Some say Javafx is agnostic and accepts any of the standards (and by the tone of the conversation imply that books are missing discussing the patterns). Others who will depend on the problem to be attacked.

In the background, perhaps what counts are these last two opinions. It remains to list and discuss the pros and cons of adopting each pattern. I hope this isn’t too wide, but it might be.

Maybe I should learn more about Javafx to ask more specific questions. But I wanted to have a north of how to study and organize my applications, and in this comes the adoption of a standard.

By the way, for Swing’s case I found that recommendation who has an attitude of authority.

  • Related: https://answall.com/q/21539/101 and https://answall.com/q/214658/101

  • The use of MVC is pointed out as a good practice by Oracle (https://docs.oracle.com/javafx/2/best_practices/jfxpub-best_practices.htm) when using FXML for screen construction. But when you don’t use FXML (I find it particularly awful) they don’t say anything about it.

1 answer

1

Well, I believe it will vary according to your project and what you feel most comfortable with.
I’m in a project that I use MVCD (Model, View, Controller and DAO) so I see no difficulty in organizing the structure.
And working with JAVAFX we also have the CSS part that is part of the View so the ideal and you organize in a way that is not lost in the structure.

Hug.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.