If my Dao layer throws Dao specific exceptions, then does handling them in my service layer consitute a leakage of concerns? If yes, then should I make the exceptions generi
Your DAO layer already leaks into the service layer when you do operations like:
userDAO.persist(user);
Exceptions, being a part of the API just like operation should be considered in the same way.
try {
userDAO.persist(user);
} catch (DAOException e) {
// looks fine to me
}
Leakage can happen with runtime exceptions, or when you rethrow exceptions
try {
userDAO.persist(user);
} catch (SQLException e) {
// sql implementation exposed
}
But even this sounds better than "layer independent" exceptions