Un viaje sobre lenguajes, APIs y otras cosas raras en el mundo del desarrollo de sistemas.


I have some time using JavaFX already and i love it.

The best configuration (at this point) for you to use JavaFX  is simple to install and use. Here you will  find tips on how to make a complex (or simple) JavaFX program and how to generate the needed packages to have a clean and easy to maintain and understand project.

To start you must install NetBeans 7.2 -with glassfish- (or later if you are seeing this view after a new version is released), Java 7 (necessarily because there are a lot of improvements on the language and JavaFX is part of it now) and Scene Builder (last version).

You must think on your Jar modules to be grouped with the needed granularity based on your business logic and also as a MVC solution (Model – View – Controller).

On JavaFX the model will be our “Domain Model” (that is the model that represents our reality on the world translated to java objects, usually known as business logic and DAO) and it will bring the necessarily data to our controller to make the view  right interaction with the user. That is, for practical purposes, we should see three different “strong” layers on our program: the one that “paints” the object on the screen (View), the one that fills them with information (controller) and the one that process the data and obtains the information (Model).

If you are used to use Java (or simple Design) Patterns you will want to generate TO (or DTOs) to transfer the data between layers. A TO is, finally by definition, a plain object (POJO – plain object Java Object) that has only the attributes and the getters /setters – NOTHING ELSE -.

The Models will search for the data using DAOs (Data Access Objects) that will be done JUST TO access the databases or information containers, the must be the only objects with the capacity to reach the data repositories and the MUST NO to manipulate the content of the data, the just obtain the data and put it on the TO to be used by the business logic objects that will transform them and will take the right decisions.

Our View in JavaFX is, as a suggestion, given by FXML files that are a variety of XML files defining the User Interface and that will delegate the controllers the required actions to interact with the user when he uses any component.

The controller will decide how the view will behave and how it will be communicate with our business Model according with the needs of this model, for example:

FXML  file:

<Button fx:id=”myButton” onAction=”#doSomething” text=”do something”/>

Controller.java file:

private void doSomething(ActionEvent evt){
   // Code to execute when the users clicks the button....

}

That’s the way our controller will use (inside the “Code to execute when the users clicks the button….”) the business model that we have done.

Once we have understand this we will just mention that for the examples to come we will use Spring Framework version 3.0 in the DAOs interfaces and that this is not intended to be a JavaFX tutorial but a general terms vision with tips on how to reach an agile application that will integrate the benefits of the framework (JavaFX)

Greetings and wait for the next post, next week.

About these ads

Deja un comentario

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s

Seguir

Recibe cada nueva publicación en tu buzón de correo electrónico.

%d personas les gusta esto: