Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

MVC architecture.

 
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Continue the conversation here.
 
    Bookmark Topic Watch Topic
  • New Topic