Hi,
I recently came upon this issue in my project and would like to know your expert opinion/experience in this regard.
My project has two applications that want to use the same set of objects, although at different depths of the object tree (some might want the whole object graph, while others might want it lazily).
One suggestion that was put up to maintain the DAO classes (the ones that actually talk to Hibernate) was to create a wrapper (or DAO) around Hibernate to abstract the concept of Hibernate to the two applications. This means that we might have to end up sacrificing the Session concept as the wrapper does not want to expose the concept of a Session to the applications, as it is a Hibernate-specific concept. This means the wrapper either has to provide full object graphs, or methods that would return partial object graphs at different depths (which can probably get messy as the depths change or combinations change).
My question is: is such a wrapper on Hibernate necessary? Is there a need to use an Hibernate Session without knowing that it is an Hibernate session? How have some of your implementations been?
Any thoughts would be greatly appreciated.
Thank you.
|