• Post Reply 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Where do DB Interface and I/O-Operations belong in MVC Pattern?

 
Ranch Hand
Posts: 147
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I'm working at a rather large private project for the first time, and it's differet from everything I had to do at work. Now I'm about to write my mySQL interface class (for storing and retrieving data) and an I/O class (for output files in CSV and input / upload of new files), and I'm not sure if they belong to the controller or the model. My intuition says it's model because it contains only logic, so that I'd have to write a seperate controller that uses the implemented interfaces. Is this the right approach?
 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Typically your persistence operations will occur in the model, yes. The model should be talking with a generic persistence interface though, not specifically with SQL or file/IO, since the persistence mechanism could change.
 
reply
    Bookmark Topic Watch Topic
  • New Topic