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

  • Home
  • SEARCH
  • 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 45127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:45:36+00:00 2026-05-10T15:45:36+00:00

My understanding of the MVC is as follows (incase it’s horribly wrong, I am

  • 0

My understanding of the MVC is as follows (incase it’s horribly wrong, I am afterall new to it)

  1. Models are the things that interface with the database
  2. Views are the design/layout of the page
  3. Controllers are where everything starts and are essentially the page logic

I’m using CodeIgniter but I would hazard a guess it’s not just limited to that or possibly even just to PHP frameworks.

Where do I put global classes?

I may have a model for Products and I then run a query that collects 20 products from the database. Do I now make 20 models or should I have a separate class for it, if the latter, where do I put this class (other controllers will need to use it too)

  • 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. 2026-05-10T15:45:37+00:00Added an answer on May 10, 2026 at 3:45 pm

    Model is the wrong word to use when discussing what to do with products: each product is a value object (VO) (or data transfer objet/DTO, whatever fits in your mouth better). Value objects generally have the same fields that a table contains. In your case ProductVO should have the fields that are in Products table.

    Model is a Data Access Object (DAO) that has methods like

    findByPk --> returns a single value object findAll --> returns a collection of value objects (0-n) etc. 

    In your case you would have a ProductDAO that has something like the above methods. This ProductDAO would then return ProductVO’s and collections of them.

    Data Access Objects can also return Business Objects (BO) which may contain multiple VO’s and additional methods that are business case specific.

    Addendum: In your controller you call a ProductDAO to find the products you want. The returned ProductVO(s) are then passed to the view (as request attributes in Java). The view then loops through/displays the data from the productVO’s.

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

Sidebar

Ask A Question

Stats

  • Questions 66k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Modan, I experienced something similar years ago and the only… May 11, 2026 at 11:32 am
  • added an answer Say a and b are the two objects. If you… May 11, 2026 at 11:32 am
  • added an answer Here is the 'Dispose' method of the SqlConnection class: protected… May 11, 2026 at 11:32 am

Related Questions

My understanding of the MVC is as follows (incase it's horribly wrong, I am
My understanding of the Git pack file format is something like: Where the table
From my understanding of the CSS spec, a table above or below a paragraph
My understanding of Hibernate is that as objects are loaded from the DB they
In my understanding of Servlet, the Servlet will be instantiated by the Container, its
My understanding of Linq to Sql is it will take my Linq statement and
Maybe my understanding of agile development isn't as good as it should be, but
If my understanding of deep and shallow copying is correct my question is an
I thought a great way to test my understanding of generic functions would be
Perhaps I am missing something, but I am just learning javascript. My understanding of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.