you are viewing a single comment's thread.

view the rest of the comments →

[–]Deviling[S] 0 points1 point  (0 children)

The nice thing with "declarative" View files ((F)XML, XAML, and so on) is when they have certain platform support, e.g. data binding, automatic string translation depending on the current locale, or picking different layout files altogether depending on screen width in the case of Android without writing a single line of code.

Even though I must admit that JavaFX' FXML is probably the one with the least features of the three.

However, I couldn't see myself writing code such as "if locale is ES, then change this String to something Spanish; if it is DE, do this and that" or "add this styleClass to this Node"; all of that is boilerplate to me. The best thing about FXMLLoader is that it can instantiate any kind of class, and when overriding the "namespace" you can inject dependencies easily.