posted 12 years ago
Actually, I've been using a 2-layer approach lately. I need "business logic" that must run inside a transaction with attached objects. Those functions go in my Service layer. To keep access to individual tables simple, the Service layer calls DAO objects in the lower-level Persistence Layer.
I put quotes around "business logic" because most of the "business" involves manipulating object relationships and stuff like that. I prefer the real business logic to be above the database transaction level, working with the detached objects.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.