-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Architectural Issues - Desining an Resource Tier Interface
PostPosted: Tue May 04, 2004 11:02 am 
Newbie

Joined: Fri Dec 05, 2003 11:05 am
Posts: 9
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 04, 2004 10:30 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Just a clarification of term DTO... If you are going to use the DTO pattern, DTOs are *always* transient. Thats the whole point behind that pattern.

So is this truly 3 tier? Or are you simply defining your business functions in terms of 3 layers all hosted within the same VM?

If its the latter, then there is really no compelling reason to even utilize DTOs. Simply have the DAOs broker requests to Hibernate and use the domain entities (i.e., the classes you've mapped in Hibernate) as the exchange between the layers.

If its the former, then you have two broad options:
1) Utilize Hibernate's detached object support;
2) Utilize DTOs and offload data from the domain entities into DTOs for return to the client.

Each has pros and cons, and each have been discussed here many many times.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.