• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate or JDO or EJB or Castor or even others ?

 
Gundum Hoi
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to determine/settle on a persistence mechanism to use for a new project.
Which object/relational persistence mechanism will you use if you are starting a new project?

Hibernate ?
EJB Entity Bean ver 3.x ?
Castor ?
JDO ?
Others ?

Should I just write off EJB 2.x because of its �problems� and complexities and favor EJB 3 or Hibernate?

I only want to choose those technologies with its spec already released to the public and there are already actual stable implementations & support by server vendors.

Which strike the balance between being reasonably new but yet reasonably stable�with huge support from the developers community and vendors?


Note: I'll develop on J2EE 1.4 (supports up to EJB 2.1?) as I think J2EE 1.5 is too new. What do you think ?
[ June 12, 2006: Message edited by: gundum hoi ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are no certain answers to any of the questions you ask, with the exception of:

Should I just write off EJB 2.x because of its �problems� and complexities and favor EJB 3 or Hibernate?

Yup. Given the alternatives available to you I wouldn't touch Entity Beans (of course 2.X Session & Message-Driven beans are fine).

I would be slightly wary of JDO. Nothing wrong with it as a technology but the choice by Sun to pursue a different persistence technology in EJB3 makes me worry that it will only become increasingly marginalized. Of course this is is only me speculating, and others may feel different, feel free to ignore me if you feel JDO is "best fit".
[ June 12, 2006: Message edited by: Paul Sturrock ]
 
Pj Murray
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by gundum hoi:


I only want to choose those technologies with its spec already released to the public and there are already actual stable implementations & support by server vendors.





That's a very mature and wise way to approach this.


There's a blog posting with a comparison of Java persistence choices here:

http://www.codefutures.com/weblog/corporate/archives/2005/02/data_persistenc.html

Of course, you need to decide if you really want to use a mapping tool. You may find these blog postings on "DAO versus ORM" and "Choosing a Java persistence strategy" interesting:

http://www.codefutures.com/weblog/andygrove/archives/2005/02/data_access_obj.html


http://www.codefutures.com/weblog/andygrove/archives/2005/01/choosing_a_java.html


Hopefully this will be helpful.
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would use Hibernate because I already used JDO and I'd like to learn something new.

JPOX JDO is very nice to use and I like the philosophy of JDO better than that of Hibernate. Hibernate enjoys wide support.

DAO vs. ORM seems an odd choice. How does one get rid of the DAO even when using ORM?
 
Erik Bengtson
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Others ?


JDBC or Ibatis if you prefer straight SQL

Hibernate ?


Widely used, but it is not a standard

EJB Entity Bean ver 3.x ?


Most implementations require JRE 1.5: Hibernate, Kodo, Toplink, etc.

JPOX will support up to 1.3.1 version

Castor ?

...
JDO ?


JDO is much richer than any other standard. You can check JPOX for more information, benchmarks, etc

Others ?

...
 
Gundum Hoi
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all the replies.

Do I use DAO together with Hibernate or choose one?
"either or" or "both" ?


Thanks.
 
Gundum Hoi
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I edited my original post...because I accidentally missed out the "1.5".

I'll develop on J2EE 1.4 (supports up to EJB 2.1?) as I think J2EE 1.5 is too new. What do you think ?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by gundum hoi:
Thanks for all the replies.

Do I use DAO together with Hibernate or choose one?
"either or" or "both" ?


Thanks.



Hibernate is an ORM tool and a DAO is a "Design Pattern", it isn't an either or question. But if you want a nice clean design then use a DAO that has Hibernate code in it.

A DAO is a class that accesses the database for you, how you access the database is your choice of anything. Hibernate, JDO, EJB, Castor, it is a way to make the "query to a table" reside in one place that all your code that will ever need to query that table can reuse the DAO.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic