Results 1 to 6 of 6
Thread: One model or many?
May 29, 2007, 18:53 #1
- Join Date
- May 2007
- 0 Post(s)
- 0 Thread(s)
One model or many?
I'm going to build a basic forum-type of application -- something with different discussions on art, music, and literature. A user would go to one of three pages based on those categories and read or participate in a discussion.
Should I create 3 different models (ArtDiscussion, MusicDiscussion, and LitDiscussion) and let them live independently? Or should I create 1 model and have my 3 sections derive from that?
I can see benefits to both but I'm wondering if there is a best-practice. The benefit to creating 3 different models is that I can easily keep them all distinct. Each model lends itself to a different part of my site. Someone who is interested in discussing 'art' will only interact with the art discussion. If I ever want to add another discussion category, I'll simply create a new model for that category.
On the other hand, it seems cleaner to have just one model -- Discussion -- with a column called "category" that will contain either "art", "music", or "literature." Since all other columns will be the same, there doesn't seem to be a strong reason to have multiple models. However, every time someone goes to the art discussion page, my application will have to sort through every discussion topic and pull out only those with a category equal to "art." Is this a problem? Any suggestions?