aspose file tools*
The moose likes JDBC and the fly likes Resource for designing persistence layer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Resource for designing persistence layer" Watch "Resource for designing persistence layer" New topic
Author

Resource for designing persistence layer

Yan Lee
Ranch Hand

Joined: Sep 15, 2003
Posts: 94
Hi:
I am coding a J2EE application using Tomcat-JBoss-MySql combo. I am only going to implement BMP's. I want to design/implement the persistence layer.
I have been looking at the DAO pattern too.
Can you tell me what one should keep in mind while designing the persistence layer? Or is it better to use an OR tool?
Can you refer some resource that gives guidelines for designing the persistence layer?
Thanks in advance.
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
If you must use entity beans (why?) and CMP is out (why?), I'd definitely use an O/R tool. Hibernate or any decent JDO implementation will do nicely. I'd never consider using anything else. I've written plain ol' JDBC BMP; been there, done that, worn the tar and feathers
I'd really query the decision to use entity beans however. Using BMP saddles you with the n+1 finder problem. Did you consider POJO persistence using Hibernate or JDO behind a session facade?
- Peter
Yan Lee
Ranch Hand

Joined: Sep 15, 2003
Posts: 94
Correction to my earlier statement. I am NOT using any entity beans only session beans in the project.
Thanks for pointing it out.
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Ok. This may be more than you're asking for, but explore what the C2 Wiki has to say about OR mapping. There's also an interesting OR tool comparison there. You'll find a wealth of design and pattern discussion in the wiki, with contributions from some illustrious names.
- Peter
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Resource for designing persistence layer