I performed only the implementation of the service level, did not bother with the interfaces (except when I had to). I probably should figure out how to write interfaces, but so far no problem. I do unit testing just fine, not mocking the level of service.
Also, I don’t have a DAO layer since I am using hibernation and it seemed redundant. Many of my arguments are based on this blog, eloquently written by Bojo .
I think this is quite controversial (be it DAO and hibernate), however I am quite happy with my decision, I am transferring thick domain objects and then just call the hibernation session. Each method at the dao level will literally have only one line (session.persist (mObject) or similar).
One argument I've heard about this is the dao layer, which will make it easier to change / remove orm later. I’m not sure that the time taken to encode the dao level, primarily added to the encoding time of the change, will be less than coding the change without the dao layer on its own. I never had to change ORM technology anywhere I worked, so its a little risk.
Nimchimpsky
source share