Immutables 2.0 for sexy Immutable Object Creation and more

Using immutable objects in Java (and other programming languages as well) is a good thing because immutable objects may be shared safely, are thread-safe and reduce the risk of side effects in your applications. Nowadays multiple frameworks exist to reduce the need of writing boilerplate code here but there is one special framework whose features I’d like to demonstrate in the following short tutorial. It hooks into your application using annotation processing and generates type-safe builders, toString, hashCode, equals methods for you, supports lazy attributes, singleton instances, serialization into data-formats like JSON and a lot of other features,too. ...

April 26, 2015 · 7 min · 1370 words · Micha Kops

Easy Database Migrations using Flyway, Java EE 6 and GlassFish

Database migrations often are a necessity in the application development and maintenance life-cycle. Whenever we need to apply changes to the database structure, insert new data fragments and in doing so want to be sure that this all happens with some control and versioning. The following tutorial shows how implement this for a simple Java EE 6 web application to be run on a GlassFish application server in a few quick steps using the Flyway framework, an eager initialized Singleton EJB and some Maven wiring. ...

April 28, 2013 · 9 min · 1742 words · Micha Kops