Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I manage a rather large, feature full nightmare of a site which has no end of feature creep settings/options/etc.

Up to now its been coded in a procedural/functional way and would like to move to an OO,MVC setup. I'm quite new to it all but have done alot of research and feel that CodeIgniter is a code choice of framework to use to help quicken the transfer. Before looking at a framework, I started constructing a list of objects to create classes out of:

  • photos
  • users
  • forum topics
  • forums
  • blogs
  • blog posts
  • comments

The trouble I have now, is I do understand where these generic/universal objects fall into the CI MVC setup. What is the best way to organise this kind of stuff? These classes can generally be used on multiple models/views/controllers.

share|improve this question
up vote 3 down vote accepted

"These classes can generally used on multiple models/views/controllers". From a MVC perspective there is no problem of a model being used in several controllers and views.

So you are left with the model, but as far as I see, there should simply be one model class for each of those objects, since they relate to one database table each. Then they may interact with each other, which partially may be handled by the controller or by the models themselves (depending a bit on use case, preferably by the models).

share|improve this answer
In other words, "these classes" basically are the models (though not without some refactoring to get non-model code where it belongs). – Shauna Dec 7 '12 at 14:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.