i have been using playframework since 2 years. Framework has "JPA on streoids" feature. I loved it very much.
http://www.playframework.org/documentation/1.2.4/5things
This is the sample code:
User connectedUser = User.find("byEmail", connected()).first();
...
connectedUser.delete();
...
connectedUser.save();
This aproach uses lots of helper methods. Some of them are static methods. Every model file extends Model class and voila. You may use find, save, delete, fetch...
Nowadays i use Spring MVC 3.1. I like its MVC usage. But Connectivity system is a little bit complex.
I read lots of articles. Some of them use service layer, dao layer and model layer. Some of them use only dao layer and model layer. Somes are creating DAO interfaces and DAO classes for every single model object and also service classes and service interfaces. And some of them use generic DAO classes.
in fact i am a little bit confused about all this variants.
- Why are we using DAO layer. A single hibernateUtil class and named queries is not enough for CRUD operations.
- Why don't we use play framework approach?
- Why do we use interfaces for every DAO class? Just implementation is not enough?
- Why do we use unnecessary service layer?