MVC Model architecture
- by ATT
I'm getting into CodeIgniter and trying to figure out the good architecture for my models. What kind of models would you create for the following simple example:
list page of blog entries: shows part of the entry data, number of comments
blog entry page: shows all the entry data, comment list (with part of the comment data)
comment page: shows all the comment data
I'm trying to get this right so that it's simple and effective. I don't want to load too much information (from the db) on the pages where I don't need them.
E.g. should the same entry model handle both multiple entries as well as a single entry? And how should the comments be loaded? I only need the number of comments on the multiple entries (list) page but some of the comment data on the single entry page. How would you handle this?