Welcome Guest, Not a member yet? Register   Sign In
Best MVC design practice?
#4

[eluser]oldblueday[/eluser]
Fred, as a newbie myself, I've found the forums to be quite welcoming and people tend to answer without arrogance I've found on other forums. We learn from each other, right?

1. From what I read, models should be separate from views, however you don't have to do that. CI is pretty flexible that you can do it if you want. Being a newbie, I decided to follow this rule (while I'm learning) before I learn when to break it. It's actually forced me to better ways of doing things.

2. Ditto what everyone said. Have as many controllers as you need.

3. I've been using one model per database table. For example I have tables called 'students', 'rotations', 'questions', 'quizzes', etc. So I have models named 'student', 'rotation', 'question', 'quiz', etc.

The other thing I learned is to put as much database functionality into your models as you can. You can process the data in there and output what needs to be used. This is the concept of "fat models, skinny controllers."

4. Ditto.


Messages In This Thread
Best MVC design practice? - by El Forum - 08-24-2010, 07:49 AM
Best MVC design practice? - by El Forum - 08-24-2010, 08:10 AM
Best MVC design practice? - by El Forum - 08-24-2010, 08:11 AM
Best MVC design practice? - by El Forum - 08-24-2010, 09:29 AM
Best MVC design practice? - by El Forum - 08-24-2010, 10:14 AM
Best MVC design practice? - by El Forum - 08-24-2010, 10:31 AM
Best MVC design practice? - by El Forum - 08-24-2010, 10:40 AM
Best MVC design practice? - by El Forum - 08-24-2010, 10:44 AM
Best MVC design practice? - by El Forum - 08-24-2010, 10:48 AM
Best MVC design practice? - by El Forum - 08-24-2010, 12:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB