Welcome Guest, Not a member yet? Register   Sign In
Database MVC seperation problems (beginners question)
#5

[eluser]JayTee[/eluser]
What I try to do is imagine that the model, view, and controllers exist on complete separate physical servers - and the controller's job is to handle traffic between them. With that in mind, I'd recommend coding each to handle it's unique job.
Models:
1. Handles all DB interactions
2. Returns record sets to the controller
3. Should rely on input from the controller (shouldn't echo to the browser)

Views:
1. Should NOT have any DB interaction
2. Should only have limited logic and loops for display

Controllers:
1. receive data from the view (forms, clicks, etc)
2. processes/scrubs data
3. moves data between the model and the view

There's something in the wiki that's good to read about MVC:
http://codeigniter.com/wiki/MVC/


Messages In This Thread
Database MVC seperation problems (beginners question) - by El Forum - 03-02-2009, 08:06 PM
Database MVC seperation problems (beginners question) - by El Forum - 03-02-2009, 08:13 PM
Database MVC seperation problems (beginners question) - by El Forum - 03-02-2009, 08:15 PM
Database MVC seperation problems (beginners question) - by El Forum - 03-02-2009, 08:19 PM
Database MVC seperation problems (beginners question) - by El Forum - 03-02-2009, 08:21 PM
Database MVC seperation problems (beginners question) - by El Forum - 03-02-2009, 08:49 PM
Database MVC seperation problems (beginners question) - by El Forum - 03-02-2009, 09:37 PM
Database MVC seperation problems (beginners question) - by El Forum - 03-02-2009, 09:50 PM
Database MVC seperation problems (beginners question) - by El Forum - 03-02-2009, 09:54 PM
Database MVC seperation problems (beginners question) - by El Forum - 03-03-2009, 12:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB