Monday 15 September 2014

java - Active record pattern with Hibernate -


I am developing a fairly simple web app using Spring MVC + JSP + Hibernate. To start I have followed this tutorial:

This is working properly, but I am worried about the code terminology. To support the user unit, we also have Userdog, Userdoo IIMPL, UserSyear and User SCIIPLL. I understand that for a large enterprise application you really want this but for my simple web app this is unnecessary (and unwanted) complexity, I can achieve all this in Python more easily.

So, is there any way to use Histrionic Record Design Pattern? What I'm looking for is that the user gets a base class like heir (like), you can do User.get (userName)

I have a different ORM for hibernate I'm open minded to use; I just started with that because it seems a common choice. And it is also believed that Python is similar to SQLLame.

I also get more than box solutions, which can automatically generate DAO classes, also open minded from an IDE plugin.

Any suggestions appreciated!

Paul

  UserDo, UserUIIMPL, User Service and UserServiceImpl   

Interface testing with mock objects becomes easy, I think you can get rid of them if you do not plan to use socks.

I have a simple acquisition / generator for the set - you do not require service class (s), unless the majority are included.

To reduce the code you write, take a look, though I think it might be overkill here.

No comments:

Post a Comment