3 Answers
3

The data retrieved from SQL files are not your model either, or rather database record sets should not be your model. There should be a level of translation that converts your record sets into data suitable for the Model.

In an ideal scenario your Model will be agnostic of data access logic and should mereley contain data that is pertinent to one or more Views as well as view state information as well.

Your Controller should bridge the gap between the View and the data contained in the Model such that only the Controller is concerned with data access matters.

On another note, if your SQL is NOT code then what is it? You are right to store SQL in version control because they define your application as much as anything.

This. I usually have SQL files in their own dbschema directory...
–
Yannis Rizos♦Apr 17 '12 at 14:44

That's why I'm storing it in version control, but where? My problem is where the files make logical sense among my Controller/Model/Ect folders.
–
Ben BrockaApr 17 '12 at 14:44

5

@BenBrocka: I think the point of this answer is you create a new directory, so you will have these: Controller; Model; View; Schema; Etc...
–
FrustratedWithFormsDesignerApr 17 '12 at 14:47

+1 The controller probably shouldn't be concerned with data access either, right? It should only be taking in user input and providing the proper view. Nor should the view be concerned with data access. Ideally a DAL is injected and "magically" the model is populated.
–
ElGringoGrandeApr 17 '12 at 17:31

@ElGringoGrande I agree that a DAL is a good idea, but where would you inject the DAL then? What would call the DAL?
–
maple_shaft♦Apr 17 '12 at 17:45