All of the Hibernate and J2EE books that I've seen seem to recommend a layer of DAOs where each DAO has an add, update, delete and one or more query methods for a certain object type (i.e. business object) for a J2EE web application. Any reason not to make one set of add(), update() and delete() methods on a class named something like PersistenceManager that uses reflection to determine the business object type and perform the requested persistence operation rather than making a bunch of DAOs that just delegate to Hibernate for a specific object type?
|