Browse Month

July 2017

Spring Application Coding

Building Spring Boot Application with FreeMarker, JPA, REST and Groovy Spock Tests

In this simple example I would like to show you how to build an application using a few technologies like Spring Boot with FreeMarker Java Template engine for rendering the view, Java Persistence API for storing our objects into the database and simple REST API for application’s data manipulation. We will add some Groovy integration tests using Spock testing and specification framework. Our application functionality will be very simple. We will be able to add users using both rendered HTML page and REST API and store them into in-memory┬áJava SQL database called H2. The list of users will be displayed on the main page.

Keep Reading

Getting Things Done

How I Use The Getting Things Done Method

I have been trying to organize my life according to Getting Things Done (GTD) method. This method is described in the book of the same title written by David Allen. The main idea of the method is to transfer your planned tasks and projects from your mind to a reliable external system and braking them into actionable work items. Using the system to organize your tasks instead of recalling them will help you to improve the quality of your life.

Keep Reading

Jackson Java Spring

Searching for files in Java 8 using Files.find() method, streams and lambda expressions

Since Java 8 we have a new way of finding files in a file tree using find() method from Files class. This class contains a set of static methods used for operating on files, directories, or other types of files. In this post we will implement functionality of finding files which were modified given number days ago.

Keep Reading

legacy code

How to live with badly written legacy code

Imagine yourself in a situation when you need to add a new functionality to an old and badly written code. What do you think first? “I need to refactor it all!”. Then second thought is coming: “better not to touch it too much” or “I will use a copy-paste pattern” or even “I need to change the job”. The first idea you have of course depends on your experience. In this article I would like to share my thoughts with developers who are struggling against themselves in such a situation.

Keep Reading