Using MVC style, where is the best place to call my query functions? <p>I am wondering about best practices here.</p> <p>MVC (Model - View - Controller) patterns involve separating components of your program that model the data, manipulate those models, and display those results to the user (usually through the UI) in some way.</p> <p>What about a function that takes the model data and inserts it into a database? For example I have an object called a GameBoard, and I also want the ability to insert the state of this board into the SQL database for storage / historical purposes. I have a class that holds all my query functions. I am not asking where to store the query calls themselves -- again those are all encapsulated in one class.</p> <p>But where would I call these functions <em>from</em>? Would this sort of functionality make the most sense to make it as a method of GameBoard? Or should it be part of the controller classes?</p>