Saturday, 21 November 2015

Spring Data

Spring Data it is useful framework but in my case sometimes it is too easy. Two years ago, when I worked in some company, my colleague wrote some template of framework like this.

It also have generic implementation for a CRUD operation but you have to write implementation for other types of operations. It is one another class which you have to write. It is easy but it doesn't enforce any convention of methods name.

Other huge advantage is resolving of types returning in methods. Every type has it's own meaning. Ex. You can receive a entity or a Optional<Entity> type. When it is looked for list of elements, there is more options, ex. Stream (JDK8), List, Set and Page<Entity> type where there is a information about count of all elements.

No comments:

Post a Comment