Tuesday 22 May 2018

Wrex Update: Primefaces 6 + Spring + Spring Data

https://github.com/konum/wrex/wiki


After a couple of years with out publishing anything or touching my projects, I once again installed eclipse in my home laptop and started to wonder, what can I do? Without an interesting idea to develop I thought it would be good to refresh Wrex, my quick'n dirty archetype for java applications.

The original idea of Wrex is to avoid the hassle of setting an environment for develop low scale web application or play around with the frameworks. Just a set the connection to the database and in two maven commands you get yourself a 3 tier webapp with spring, primefaces, user login, register, email sending, among other goodies. Neat and quick.

Whats new?

MySQL 8: New hard drive means new installations, so the latest version of MySQL was an obvious choice. Updated dependencies and configurations for this version.

Spring Data: Got rid of those old fashioned DAOs and added Spring Data to the backend. Spring Data is a greet tool to access your data without having to write and implementation.

DTOs: Using database entities in the front layer is really quick, but ugly as hell and can lead to serious problems with persistence. I added a wrex-api project that isolates the backend with the frontend.


MapStruct: While isolation with layers is a good thing, it adds the necessity to map between the persistence classes and the DTOs. Using MapStruct that mapping is done in compile time and you just have to create and interface. No reflection is used in runtime. Dozer, a mapping tool that uses reflection, spent 370ms mapping 10.000 simple object StructMap did the same in 7ms.

Logback: Logging is now done with logback.

Primefaces 6: Updated to PF6.2.

 POM order: I cleaned the poms a little bit.

And that's everything. It didn't take long and now Wrex looks a little more professional without loosing is founding principle.


You can get wrex at https://github.com/konum/wrex/wiki.

Next project is Garrus an Angular JS front end with a Spring Boot backend. Stay tuned!