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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:46:51+00:00 2026-05-31T09:46:51+00:00

If one uses autoloader function (with spl_autoload_register), does one need anymore: singleton: all needed

  • 0

If one uses autoloader function (with spl_autoload_register), does one need anymore:

  • singleton: all needed classes will be loaded by autoloader anyway, including database, logs, r&r, fronts etc. so need for “always on” etc. object is not clear to me
  • factory: again, autoloader will load required class, so is there a point to use factory class to instantiate worker classes implementing interface, or extending abstract class
  • 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-31T09:46:52+00:00Added an answer on May 31, 2026 at 9:46 am

    A singleton is used to hold a single instance of a particular class, so that whenever the instance is retrieved it will always be the same. Therefore, setting data will mean that the data is always the same when retrieving it.

    This is different from auto loading a class, as each time you create a new instance you reset the state to the class’ default. Still, Singletons should be used sparingly, as they are essentially glorified global variables.

    A factory pattern should be used to delegate the determination and creation of objects. It’s used when you don’t want to specify a concrete class, but require a certain sub-class under a set of conditions. You can’t pass construction parameters to an autoloader, and some complex logic may be required to work out which object should be returned from a factory, so again it doesn’t achieve the same thing.

    An autoloader should just be used to find a class file and include it. It shouldn’t (and can’t) do any logic such as instantiating an object or making decisions about which object to load.

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

Sidebar

Related Questions

When one uses free() in C, does freeing one pointer, free the contained pointers?
When one uses typedef structs within a source file and an external system will
If one uses float:left to layout two columns, does the left column have to
I understand one uses the bless keyword in Perl inside a class's new method:
Which one is faster? Which one uses less memory? Console.WriteLine(string1) Console.WriteLine(string2) Console.WriteLine(string3) Console.WriteLine(stringNth) or
I have 2 canvases, one uses HTML attributes width and height to size it,
Let's say you've inherited a C# codebase that uses one class with 200 static
How to use such functionality of windows-7 with WPF (one that uses Itunes -
I am implementing a tagging system on my website similar to one stackoverflow uses,
I am currently building an making my new website. It uses one page and

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.