aspose file tools*
The moose likes Struts and the fly likes Recommended Data Persistence Layer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Recommended Data Persistence Layer" Watch "Recommended Data Persistence Layer" New topic
Author

Recommended Data Persistence Layer

John Fontana
Ranch Hand

Joined: Feb 28, 2002
Posts: 235
This is really a re-phrase of a question I posted earlier:
I am looking into O/R products such as Torque, Hibernate and ORB for use in Struts applications. So far, I have had little luck in getting any of these to work.
I am wondering if anyone has a recommendation on a good, intuitive Data Persistence layer to start with...


www.websiteandsound.com
"If you do what you've always done, you'll get what you've always gotten."
John Fontana
Ranch Hand

Joined: Feb 28, 2002
Posts: 235
Finally had success with Castor.
Why do we never hear the words "step by step tutorial" and "open source" in the same sentence?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

John, I am struggling with the same thing you are. Could you give me some advice from your success and failures and why you chose Castor over the others?
Thanks.


GenRocket - Experts at Building Test Data
Igor Shabalov
Greenhorn

Joined: Jun 03, 2003
Posts: 7
John, I think you should consider using JDO for persistent layer.
Best,
Igor.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Igor Shabalov:
John, I think you should consider using JDO for persistent layer.
Best,
Igor.


Could you please tell us why JDO would be better than Castor? I know that Castor uses the JDO term loosely and Castor's JDO implementation does not follow Sun's JDO guidelines.
But why do you suggest JDO?
Thanks.
Igor Shabalov
Greenhorn

Joined: Jun 03, 2003
Posts: 7
Could you please tell us why JDO would be better than Castor? I know that Castor uses the JDO term loosely and Castor's JDO implementation does not follow Sun's JDO guidelines.
But why do you suggest JDO?

That's easy. JDO is open standart - and you can get several implementations very easy. You can choose free open source, or mature commercial implementation - depends from your situation. You will not be locked in specific vendor.
JDO provide you transparent persistence. Castor don't.
Best,
Igor.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Igor Shabalov:

That's easy. JDO is open standart - and you can get several implementations very easy. You can choose free open source, or mature commercial implementation - depends from your situation. You will not be locked in specific vendor.
JDO provide you transparent persistence. Castor don't.
Best,
Igor.

What about hibernate?
Ruud Steeghs
Ranch Hand

Joined: Jul 09, 2001
Posts: 56
right now we're using apchache OJB. I'm really enthusiastic about it.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Ruud Steeghs:
right now we're using apchache OJB. I'm really enthusiastic about it.

Care to share why with us?
Ruud Steeghs
Ranch Hand

Joined: Jul 09, 2001
Posts: 56
:-)
OJB is a JDO compliant API. (that's why I mentioned it here in this thread)
It is an Object Relational Mapping framework.
the pro's:
- You can easily program your queries and OJB returns classes or collections to you.
- No more converting JDBC results into Java classes.
- Queries are reduced to very little code.
- Transaction / locking management is easy.
cons:
Not all queries can be written using OJB. Some difficult queries (joins, date transformations) are still performed using JDBC. I' m not quite sure if those queries cannot be performed using OJB or it's just our inexperience.
However, over 90% of our queries are written using OJB
Cheers,
Ruud.
Igor Shabalov
Greenhorn

Joined: Jun 03, 2003
Posts: 7

What about hibernate?

Hibernate is open, but not standard.
Best,
Igor.
dave sag
Ranch Hand

Joined: Feb 17, 2003
Posts: 47
Originally posted by Igor Shabalov:

Hibernate is open, but not standard.
Best,
Igor.

I have been looking into this a bit lately and the advantage of Hibernate to me seems to be one less file to write. If my tired memory serves me correctly, with JDO you write your java, the mapping and an xschema, whereas with hibernate you just write the classes and the mappings. Both are pretty easy to use once you have your classes/mappings etc written but Hibernate seems to me to win out because it's easier to write the mappings. I am having trouble finding any trivial examples of struts and hibernate in actual use however. urls welcomed.
the other significant difference is that JDO modifies your byte code directly whereas hybernate does not. if you are doing things with JavaSpaces (as I am) you don't want your objects to be touched really.
does anyone have a simple example app showing struts and hibernate in action? ideally i'd like to see an identical app done using hibernate, castor and JDO so we can compare the differences for ourselves.
dave


JSF / Jini / Javaspaces / JDO - all rock in my opinion.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Recommended Data Persistence Layer