History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: APF-890
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Matt Raible
Reporter: Marcello Teodori
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
AppFuse

Creation of a separate appfuse-dao module for DAO api (interfaces)

Created: 17/Sep/07 05:39 AM   Updated: 09/Oct/07 11:42 AM
Component/s: Build, Test, or Deploy Process
Affects Version/s: 2.0-RC1
Fix Version/s: 2.1


 Description  « Hide
The GenericDao and UniversalDao interfaces source files are duplicated across all three DAO implementation maven projects.
They could be handled more easily if they were a separate project to be used as additional dependency from those three projects, allowing easier customization for the introduction of, say, generic finder methods, like the ones discussed in: http://www.nabble.com/Proposal-for-a-Finder-implementation-in-DAOs-for-AppFuse-t4159990s2369.html

There could be room for a wiki page that explains how to add custom generic DAO behaviour to these base classes.

 All   Comments   Change History   FishEye      Sort Order:
Matt Raible - 27/Sep/07 09:41 PM
Doesn't the current way things are arranged allow for more flexibility? For example, we could add generic finder methods for JPA and Hibernate, but not for iBATIS. If we were to implement this, we'd *have* to implement iBATIS or throw UnsupportedOperationException. I'm afraid if we start making AppFuse too modular, it can easily get out of hand and we'll end up with things like appfuse-aop, appfuse-security, etc. where each is a feature you can add to your app.

Maybe it's a good idea, who knows. However, this seems like a low priority issue. I'd rather 1) implement generic finders in all 3 and 2) if we need to consolidate, move them into data-common.

Marcello Teodori - 04/Oct/07 06:21 AM
My issue was mostly about removing the current duplication of each of the named interfaces:

./data/hibernate/src/main/java/org/appfuse/dao/GenericDao.java
./data/ibatis/src/main/java/org/appfuse/dao/GenericDao.java
./data/jpa/src/main/java/org/appfuse/dao/GenericDao.java

./data/hibernate/src/main/java/org/appfuse/dao/UniversalDao.java
./data/ibatis/src/main/java/org/appfuse/dao/UniversalDao.java
./data/jpa/src/main/java/org/appfuse/dao/UniversalDao.java

by creating a new maven module or adding a single copy to data/common,
than to add generic finder methods to those interfaces.

Unfortunately I don't have any iBATIS experience, so I cannot be helpful on the subject of developing generic finder methods for that specific framework, but I would prefer the GenericDAO and UniversalDAO to have methods that are available across all implementations, otherwise it would be impossible to switch.