Where do JavaFX FXML controllers belong in an ECB architictural design pattern?

I am wondering where does the fxml controller belong in the Entity-Control-Boundary model?

When designing a JavaFX application with the help of Scene Builder, Scene Builder generates an fxml file which represents the GUI. In addition, a controller is needed to make user interaction possible. An example would be: LoginScreenUI.fxml & LoginScreenUIController.java.

What is known:

  1. An entity object is an object that represents the system’s data.
  2. A boundary object is an object that interfaces with the system’s users.
  3. A control object is an object that implements the logic required to manage the various elements and their interactions. It serves as a mediator, i.e. the glue between boundary objects and entity objects.

All of the interpretations I found were based on a comparison to the MVC model, here are some:

  • The Entity-Control-Boundary Pattern (ECB) is a variation of the Model-View-Controller Pattern.

    Mapping to MVC:
    We can map the inner hexagon filled with entities to the Model role in the Model-View-Controller Pattern. Controllers obviously map to Controllers, and boundaries, at least boundaries that interact with users, map to views.

    hexagon

  • They are not similar. MVC is for user interaction. Business rules are not bound to users directly and even not I/O devices like the internet itself. The ECB pattern is used for separating business entities from the boundary (mvc framework, ORM’s).

  • List item

I see myself agreeing with the explanation that ECB pattern is a kind of an analogous pattern to the MVC pattern when it comes to more Client-Server like architectures. As a consequence, some differences occur when implementing each one.

However, I am not entirely satisfied as I could not find any direct answer to my question and it is still open for personal interpretation rather than having a clear guideline.

To be more concrete, when the user types ID, Password & clicks the Login button. My controller handles that button click.
Two scenarios are possible: Assuming

  1. Assuming my controller belongs to the Control category.
    I can right then and there check if the user is registered in my database by executing a query.
  2. Assuming my controller belongs to the Boundary category.
    I have to find another “middleman” class to authenticate the credentials.

I can’t move forward based on assumptions as a wrong one will significantly slow down future development and introduce many mistakes to be painfully corrected.

Any help would be much appreciated.

Thank you.

JavaFX как добавить кнопку в FXML через другой класс

Начал изучать JavaFX и столкнулся с проблемой. При добавлении элементов не из FMXL, а из другого класса, но в элемент написанный в FXML (в данном случае мне нужно вставить кнопку в контейнер BorderPane) происходит ошибка. Очень прошу помочь. А если вы знаете как разбираться в ошибках JavaFX, научите пожалуйста, куда там обращать внимание.

sample.fxml

 <?xml version="1.0" encoding="UTF-8"?>   <?import javafx.scene.layout.BorderPane?>   <BorderPane fx:id="bPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="640.0" prefWidth="480.0"             xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.Controller">  </BorderPane> 

Cotroller.java

 package sample;       import javafx.fxml.FXML;     import javafx.scene.control.Button;     import javafx.scene.layout.BorderPane;       public class Controller {          @FXML         private BorderPane bPane;           void addGrid(Button button){          //тут я написал метод для вставки             bPane.setCenter(button);         }      } 

Main.java

package sample;  import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.stage.Stage;     public class Main extends Application {      @Override     public void start(Stage primaryStage) throws Exception{         Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));         primaryStage.setTitle("Surprise Moth..Fu..er");         primaryStage.setScene(new Scene(root, 480, 640));         primaryStage.show();         Button button = new Button();           Controller controller = new Controller();         controller.addGrid(button);                        //вот вызов     }       public static void main(String[] args) {         launch(args);     } } 

ОШИБКА

мар 10, 2019 1:05:07 AM javafx.fxml.FXMLLoader$  ValueElement processValue WARNING: Loading FXML document with JavaFX API of version 10.0.1 by JavaFX runtime of version 8.0.201 Exception in Application start method java.lang.reflect.InvocationTargetException     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)     at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at sun.launcher.LauncherHelper$  FXHelper.main(LauncherHelper.java:767) Caused by: java.lang.RuntimeException: Exception in Application start method     at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)     at com.sun.javafx.application.LauncherImpl.lambda$  launchApplication$  154(LauncherImpl.java:182)     at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NullPointerException     at sample.Controller.addGrid(Controller.java:17)     at sample.Main.start(Main.java:23)     at com.sun.javafx.application.LauncherImpl.lambda$  launchApplication1$  161(LauncherImpl.java:863)     at com.sun.javafx.application.PlatformImpl.lambda$  runAndWait$  174(PlatformImpl.java:326)     at com.sun.javafx.application.PlatformImpl.lambda$  null$  172(PlatformImpl.java:295)     at java.security.AccessController.doPrivileged(Native Method)     at com.sun.javafx.application.PlatformImpl.lambda$  runLater$  173(PlatformImpl.java:294)     at com.sun.glass.ui.InvokeLaterDispatcher$  Future.run(InvokeLaterDispatcher.java:95)     at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)     at com.sun.glass.ui.win.WinApplication.lambda$  null$  147(WinApplication.java:177)     ... 1 more Exception running application sample.Main 

Nao sei bem o problema mas acredito que seja no FXML, quando esta sem o FontAwesome, JFoenix, ele abre normalmente

<?xml version="1.0" encoding="UTF-8"?>  <?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView?> <?import javafx.scene.control.Button?> <?import javafx.scene.control.Label?> <?import javafx.scene.control.TextField?> <?import javafx.scene.image.Image?> <?import javafx.scene.image.ImageView?> <?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.text.Font?>  <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: #131D27;" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">    <children>       <ImageView fitHeight="400.0" fitWidth="600.0">          <image>             <Image url="@../../../../../../Pictures/Saved%20Pictures/laptop_macbook_iphone_apple_journal_glasses_113949_1280x720.jpg" />          </image>       </ImageView>       <AnchorPane layoutX="165.0" layoutY="39.0" opacity="0.85" prefHeight="278.0" prefWidth="270.0" style="-fx-background-color: #B5ACA5;">          <children>             <Label layoutX="106.0" layoutY="26.0" text="Sing In">                <font>                   <Font size="19.0" />                </font>             </Label>             <TextField layoutX="61.0" layoutY="81.0" />             <TextField layoutX="61.0" layoutY="127.0" />             <Button layoutX="164.0" layoutY="168.0" mnemonicParsing="false" text="Button" />             <FontAwesomeIconView glyphName="GLOBE" layoutX="41.0" layoutY="98.0" size="20" />             <FontAwesomeIconView glyphName="LOCK" layoutX="44.0" layoutY="144.0" size="20" />          </children>       </AnchorPane>    </children> </AnchorPane>      package application;  import java.io.IOException;  import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage;   public class Main extends Application {     @Override     public void start(Stage stage) {         try {             Parent parent = FXMLLoader.load(getClass().getResource("/gui/test.fxml"));             Scene scene = new Scene(parent);             stage.setScene(scene);             stage.show();         } catch (IOException e) {             e.printStackTrace();         }     }      public static void main(String[] args) {         launch(args);     } } 

Erro

javafx.fxml.LoadException: /C:/Users/vinic/Documents/temp/ws-javafx/javafx/bin/gui/test.fxml

at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2625) at javafx.fxml/javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2863) at javafx.fxml/javafx.fxml.FXMLLoader.processImport(FXMLLoader.java:2707) at javafx.fxml/javafx.fxml.FXMLLoader.processProcessingInstruction(FXMLLoader.java:2676) at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2542) at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466) at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3237) at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3194) at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3163) at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3136) at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3113) at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:3106) at application.Main.start(Main.java:15) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$  launchApplication1$  9(LauncherImpl.java:846) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$  runAndWait$  12(PlatformImpl.java:455) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$  runLater$  10(PlatformImpl.java:428) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$  runLater$  11(PlatformImpl.java:427) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$  Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$  runLoop$  3(WinApplication.java:174) at java.base/java.lang.Thread.run(Thread.java:834) 

Caused by: java.lang.ClassNotFoundException: de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$ AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at javafx.fxml/javafx.fxml.FXMLLoader.loadTypeForPackage(FXMLLoader.java:2931) at javafx.fxml/javafx.fxml.FXMLLoader.loadType(FXMLLoader.java:2920) at javafx.fxml/javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2861) … 20 more