Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] [OT]-ish Generic JPA Repository Frameworks

Hi,

Regarding your question if any of these generic DAO frameworks are any good:

It would say yes. At least for grepo, as it helped us at Infonova. We
develop and
maintain relatively large applications for our customers with a
relative big development
team. We have strict rules for our DAO-Layer - besides standard CRUD operations
(like load/get/persist/update/flush/refresh etc.) we often need custom
methods to
execute custom queries (hql or jpql or native).

For such methods we do have conventions like
- methods starting with "load" always have to return a result object
or throw TooManyRows or
  NoDataFound (runtime) exceptions
- methods starting with "get" always have to return a result, null or
throw TooManyRows (runtime) exceptions
- methods starting with "find" always have to return a list or an empty list
- etc...

We had to extend most concrete DAOs from a DAOBase class (which
provided standard CRUD operations)
in order to provide the methods which execute custom queries. However
it turned out that those concrete DAOs
were often not implemented "correctly" (for instance load methods
returning null, not throwing exceptions etc...).
So we developed a framework (which resulted in grepo). Using the
framework we basically do not have to
develop concrete DAO classes anymore which saves time and furthermore
makes our DAO-Layer consistent
(e.g. a "load" method is always a "load" method etc.)

So grepo is not a framework (abstraction layer) which sits on top of
your code (because you should not have
to write custom code in most cases). Btw. grepo is non-invasive,
meaning that you can simply mix with
custom dao implementations or integrate in an existing DAO-Layer (this
is what we at Infonova actually did).

So all in all it depends on your requirements/problems/preferences
when you decide to use such a framework
or not.

Daniel


Back to the top