Yes, I have some rough notes written down but since we are busy now I
didn't have time to put them here. My initial comparison was with
Hades as Hussachai mentioned this OpenSource library in his post. Here
are my notes so far - they are, however, not categorized using
criteria outlined above.
I've taken a quick look at Hades (
http://trac.synyx.org/hades/wiki).
Here are my thoughts - a comparison against DAO Fusion, taken mostly
from "hades-reference.pdf". This is not meant to say that one library
is better than the other one, it's just my point of view on some of
their aspects.
Persistent entity model - compare PersistentEntity interface hierarchy
for both libraries (I am wondering why Hades chose to include method
such as isNew() to an entity interface since the underlying entity
state handling is managed by Hibernate anyway)
- DF Persistable interface gives you hints how to implement object
identity, hashCode/equals implementation options, inheritance
mappings, etc.
- DF users don't have to repeat code such as @Id Long id / getId() /
setId() since this is handled by PersistentEntity which is essentially
a @MappedSuperclass
- DF features support for mutable/immutable entities (mutable with
optimistic locking support)
- DF features PersistentEnumeration useful for enumerated types to be
persisted into database
Standard DAO functionality
- DF's PersistentEntityDao allows you to have one DAO for many
entities that share a common parent entity (e.g. a common DAO for
persistent enumerations)
- DF has a sophisticated persistent entity criteria API, see
PersistentEntityCriteria and related classes, note that this criteria
API is object-oriented, in contrast to AOP proxy magic / named queries
supported by Hades
- Hades' "read by example" logic (ExtendedGenericDao) is ultimately
implemented via Hibernate query-by-example, which works on direct
properties of persistent entities only
- Hades contains GenericDaoFactoryBean that creates dynamic proxies
(actual DAO implementations), so you just specify DAO interface,
custom business-specific DAO functionality integration is a little bit
cumbersome (I have to declare additional "MyDaoCustom" interface)
- Hades "finder methods" are quite restricted in their functionality,
because string-based NamedQueries are inefficient/unmanageable in long
term and dynamic finder method arguments (CREATE mode) work only on
direct entity properties only
Hades has an interesting auditability support (alternative approach to
AOP = use native Hibernate entity life cycle hooks). The custom Spring
namespace support is also very nice. However, DF does not force you to
use Spring, it focuses purely on JPA/Hibernate (Spring is required for
integration tests only).
I kind of missed following things in Hades:
- advanced query support (filtering entities by nested properties, for
example)
- integration test support, core integration tests to prove standard
DAO functionality on non-trivial sample domain for most popular
databases
- some discussion about hashCode/equals implementation alternatives,
object identity versus database identity, their pros and cons, etc.
To sum it up, Hades is nice and efficient library for smaller
projects, especially when you are familiar with writing named queries
(your domain model will get more complex as your application grows).
DAO Fusion, on the other hand, provides tools for building and testing
DAO layers for complex domain models - object-oriented criteria API
which shields you from Hibernate details, integration test support,
rich entity model / DAO functionality, Criteria Transfer Object (CTO)
pattern implementation, etc.
As mentioned above, each library has its own target domain and
specific features suitable for different styles of developing DAO
layers.
Vojtech
On Jun 10, 11:16 pm, Suresh Sanjeev Rashid <
rashid...@gmail.com>
wrote: