Hello,
I am designing a 3-Tier System that uses Hibernate and the Main point is: I read some of the docs available in the site (including the Hibernate Manual) and when I terminated I felt that I understood the main points about Hibernate, I knew how to use the API, I could read the code to know more about it, I extended HIbernate and used Stored Procedures to insert, update, delete and auto-generate IDs for the inserted entities, but ....
... I am not self confident to find out the best way to put Hibernate in our Archicteture...
The question is:
Ok, I understand the Hibernate API, but How Hibernate fits in our artchitecture ?
The idea is to use DAOs to encapsulate DB Access... But how to design a Resource Tier Interface able to keep all Hibernate code inside it ?
The BusinessObjects(BOs) in the Business Tier will be always transient? always persistent? If none of the previous, I would have to manage in which state they were... How to manage it? (The bussiness tier should not even know about these issues.... )
Another alternative is to only persist Data Transfer Objects(DTOs, the also called VOs) and in this case all the BOs will be transient... but i didnt feel confortable with this approach mainly because all the Hibernate doco talks about persisting BOs... In my opinion, the main idea of Hibernate is to try to forget that you have a DB and that you must "save" objects when you change their states... rigth? ... so you just change the objects and then in some way they will be persisted...
Does anybody know how 3-Tier Projects that uses Hibernate are dealing with issue? Is there some book or article describing the Architecture of Projects that are using Hibernate?
Any comments, ideas and suggestions are welcome,
Thanks in advance,
Leonardo.
_________________ Leonardo Figueiredo Almeida
|