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 7923549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:21:38+00:00 2026-06-03T17:21:38+00:00

Sorry if is a dummy question but I’m not really clear with it. Is

  • 0

Sorry if is a dummy question but I’m not really clear with it. Is it a good practice to integrate factory pattern in an mvc using php. For example could I have the following library structure:

index.php
 --init
   --abstract factory class for models
 --models 
   --model extend factory class 
 --controllers
 --views
  • 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-06-03T17:21:39+00:00Added an answer on June 3, 2026 at 5:21 pm

    One thing to note here is that models are not supposed to extend from factories, instead you would normally use the factories directly, which in turn should return a model initialized. E.g. imagine you have a frozen pizza (model) and a oven (factory); rather than eating the frozen pizza directly, you use the oven first, from which in turn you get the actual edible pizza. For a very complex type of oven (read, if the object creation process involves a lot) the factory pattern makes sense.

    Other than that, no reason not to use the pattern if you feel it is useful for your needs. I generally include the factories directly where I store the models aswell, since they both strongly depend on each other (as in, one would not work without the other), but that’s just a matter of taste I guess.

    One last tip: use patterns when you really think you need them, not because they sound fancy. If you think not using the factory pattern makes your life easier and will get your project done faster, then by all means don’t use it. That’s not to say you shouldn’t explore new patterns, but always rationalize whether the time and effort to implement and maintain them is justified.

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

Sidebar

Related Questions

sorry for lamer question, but I really could not found subject. I have a
Sorry for a long question and not a very descriptive title, but my problem
Sorry for the probably dummy question but I'm lost. can Wi-fi network strength (dBm)
Sorry for the Dummy Question , i know :( ,, but it's only the
Sorry if it was already asked before, but I really couldn't find a clear
Sorry for the dummy question but I'm a regular expressions newbie. I want these
Sorry for kind of a dumb question, but I haven't found a good manual.
Sorry for this basic question but my searches on this are not turning up
Im sorry for this probably dumm question, but I want to simply open modals
sorry for the lame question but with HTTP handler it is easy to do

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.