This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
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
Joined: Sep 15, 2003
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
Joined: Apr 20, 2000
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