• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Jan Hoppmann
Ranch Hand
Posts: 147
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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?
 
Jeff Storey
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!