Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 521357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:14:31+00:00 2026-05-13T08:14:31+00:00

I want to use a good mvc naming convention for a forum im creating.

  • 0

I want to use a good mvc naming convention for a forum im creating.

I wonder, should I use this structure:

controller: threads
model: threads_model (eg. $threads_model->get_all_threads, $threads_model->add_thread, $threads_model->add_post, $threads_model->add_comment)

controller: tags
model: tags_model (eg. $tags_model->get_all_tags, $tags_model->add_tag)

controller: users
model: users_model (eg. $users_model->get_all_users, $users_model->add_user)

or

controller: content
model: content_model (eg. $content_model->get_all_tags, $content_model->get_all threads...)

controller: users
model: users_model (eg. $users_model->get_all_users, $users_model->add_user)

this is my first time using mvc so I want to know what is best practice for this. should i like in the first example separate every “thing” (tags, threads, users…) or should I use the second one? further more, should i in the first example separate comments and posts as well so they will be their own controllers/models?

would be good if someone gave me some good mvc pattern for forums.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:14:31+00:00Added an answer on May 13, 2026 at 8:14 am

    Over the 2 you have posted, id say the 1st structure is best. Think about your system as separate entities, and the relations between them. As a simple example

    Thread
    Reply
    User
    Tag
    

    In this case som appropriate associations would be..

    User can create many threads
    User can create many replies
    
    Reply Belongs to a User
    Reply Belongs to a thread
    
    Thread belongs to a user
    Thread has many replies
    Thread has many tags
    
    Tag has many threads
    

    Once the associations are made its a bit clearer to think of the methods needed, such as:

    **User**
    Get Threads: Returns all threads created by this user
    Get Replies: Returns all replies created by this user
    
    **Thread**
    Get User: Returns the User that created this thread
    Get Replies: Return all replies to this thread
    
    **Reply**
    Get User: Returns the User that created this reply
    Get Thread: Returns the Thread that this user belongs to
    

    There would obviously be more methods for example in the user model you may want to return a particular thread by an id so you would also have a GetThread method that you would pass an id.

    Hope this gets you thinking a bit!

    One further point is that in your models, such as your Tag model, you have a method addTag, as far as i am aware, you wouldn’t really want this method in your model, as then it could only be called by a tag. If you had to create a tag to add a tag you’d get pretty stuck. Id move this into the controller.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you want to learn how to use Perl interpreter threads, there's good documentation
I want to use Gama component in Android to make our app good.I have
I've heard of Qtip, and it looks good for what I want to use.
Can I use UnityContainer in View's codebehind when I want to write good MVVM
I am attempting to use Scintilla .NET in a project (I want a good
I want use this 1 for using Bar code or QR code scanner. I
What is a good method for loosely-coupled inter-controller communication in MVC/MVP? For example, in
I want to use fiddler with asp.net MVC 3 application to see when I
I'm using Spring MVC for a web app. I want to use OpenID for
I need to make a web application and I want to use MVC. However,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.