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, is it a right practice to use the same bean for doing database manipulation and storage ??? i mean, does it affect performace if i use a bean for database access and the same bean for setters and getters ?? or shld i used one bean for database related things and another bean for getters and setters ??? i think making confusion !! .. not sure if this is the right forum to post this message..if therez any other forum for MVC architecture , plz gimme the url.. thanks raj
SCJP, SCWCD, SCBCD, Oracle Certified Professional (SQL n PL/SQL)
Please don't post to more than one forum. Cross-posting just makes following the threads of discussion so much harder. The problem that you are talking about is not really MVC architecture at all and is really about database access design patterns. The patterns that you are applying are well-known and well-defined. In my opinion you should create 2 separate classes:- The first class would be a Value Object which is basically just a plain old Java bean with the getters & setters. The second class is a Data Access Object which instantiates the Value Objects by appling SQL SELECT statements against the database and handles the UPDATE, INSERT and DELETE statements. Hope this helps
Andy Bowes<br />SCJP, SCWCD<br />I like deadlines, I love the whoosing noise they make as they go flying past - Douglas Adams
Joined: Aug 27, 2002
hi andy, thanks for ur expert answer..im really sorry for posting my message in jsp and servlets forum..i didnt know where to post my message so just thought to put it in both forums...anyway i wont repeat it.. thanks raj