I agree. My favorite method is to use Domain Driven Design techniques.
From: Malcolm Edgar
To: user
Sent: Thu, April 1, 2010 6:32:05 AM
Subject: Re: Cayenne pattern quesiton
I would argue against putting finder methods in the generated
entities, as I think i
I would argue against putting finder methods in the generated
entities, as I think it is a separate concern and you can easily end
up with tightly coupled code which is difficult to refactor.
The "Rich Domain" model can end up becoming the "Blob" anti-pattern.
I don't think stateful entities obje
Also I suspect I am not using a classic version of DAO. My DAO's are
morphed with the "business layer" and can have interactions with other
subsystems, not just Cayenne (e.g. caching, data access via web
services, etc.). Also they are not auto-generated, as any new methods
are created when
I am using a form of DAOs (with injection) with the main reason being
that I can provide alternative implementations in a context-sensitive
manner without changing the DAO interface (something that can't be
done with the static methods), which is very handy in numerous
situations.
Andrus