• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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

 
Ranch Hand
Posts: 160
Python Java 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic