-->
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.  [ 5 posts ] 
Author Message
 Post subject: Hibernate, DAO pattern, EJB and Plain JavaBean
PostPosted: Wed Oct 15, 2003 6:04 am 
Beginner
Beginner

Joined: Thu Oct 02, 2003 8:02 am
Posts: 45
I work on an web site project and I use hibernate with others technologies as EJB, plain JavaBeans and a RDBMS. I use also the DAO pattern. With so many technologies, i don't know excatly wich is the best approach. The problem is that i dont' know how to use the DAO pattern with hibernate, EJB and plain JavaBeans.
Can you help me to understand the role of each component and as possible can you give me an exemple that will make me understand .

Second, is it essential to use EJB in such a project ? ( can you give me some explanations )

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 6:10 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
This would be the scope of several books!

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 9:32 am 
Newbie

Joined: Sun Aug 31, 2003 8:49 am
Posts: 5
Although christian is right, there is too much to tell in response to these questions, I would say the short answer to your question:

"Second, is it essential to use EJB in such a project ?"

Is no.

If you can get away with it, avoid the use of EJBs. There are certain situations where they are very useful, but if your intent is to craft a persistance layer in a straightforward N-tier web application, then go with straight Hibernate. If you are concerned about tight coupling with Hibernate, apply the DAO pattern to hide the implementation details..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 11:33 am 
Regular
Regular

Joined: Fri Sep 05, 2003 12:01 am
Posts: 80
Location: Bogot
those are not questions: they are existential problems!! ;-) just kidding!


I began developing webapps with java about 3 years ago. I started using EJB's back then and my impression now is that they are somewhat an overkill for most webapps today. With and ORM like hibernate (which performs well and is relatively light) IMHO don't see (for most cases) why you should use Entity EJB's.

As for session EJB's, I have the impression that they are more widely accepted, but EJB's have a steep learning curve and I think its easier to missuse them than actually use them properly.

My general suggestions are:

    use MVC pattern (a framework like struts helps a lot here).
    KISS (Keep it simple), the fewer the techonologies you mix the better
    Besides, you're problably part of a team, so it helps the collaboration effort.

_________________
Mauricio Hern


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 8:11 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
You can abstract the backend from the front using an API. I prefer to use the Command pattern which allows a local Command processor to be used in a servlet only senario or it can be an SLSB Command processor. It is all hidden by the API so I can switch it in and out as required. For example, one situation that the remote call may not be desirable is during the test suite execution. This means I don't have to have a container running to execute the tests.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.