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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:10:04+00:00 2026-05-29T22:10:04+00:00

I am reading factory method pattern as I have some issues related to it

  • 0

I am reading factory method pattern as I have some issues related to it but I am unable to understand it from core. As per definition stated here

The creation of an object often requires complex processes not
appropriate to include within a composing object. The object’s
creation may lead to a significant duplication of code, may require
information not accessible to the composing object, may not provide a
sufficient level of abstraction, or may otherwise not be part of the
composing object’s concerns.

I can understand the concept of duplication of significant code, but I am unable to understand the other concepts like it states

It may require information not accessible to the composing object

How a class can contain the infomation which ic not accessible by composing object. As for as I understand it may be any private datamember of the class. But if any thing is private then how object creation process needs that information? Similarly other two point

It may not provide a sufficient level of abstraction, or may otherwise not be part of the composing object’s concerns.

Can any body please here describe these precisely and show my some code stuff so that I can understand the concept

  • 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-29T22:10:06+00:00Added an answer on May 29, 2026 at 10:10 pm

    The idea of factory pattern is to create load classes and create new objects dynamically. Quite often it is done as a static class (such as here, in the official PHP documentation), but some frameworks use factory pattern as a way of loading objects within MVC objects, for example when you want to load some data in view through a model.

    The idea of factory pattern is efficiency and resource management. It loads a file only when it’s not been loaded yet and returns the newly created object.

    (Note that the example in PHP documentation is not ideal, it would be better to check if the class has been defined and if not, then attempt to include the file instead of using include_once())

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

Sidebar

Related Questions

I have learnt the factory method design pattern, and at the same time, I
I'm reading how the cooley tukey method works , but I have a few
I have been reading about Factory pattern a lot lately. I am trying to
I've been having some issues reading an XML file in my 'res' folder and
From reading the memory management docs in the SDK, I gathered that factory methods
I'm having some problems reading data from XML and load it into an array.
I am reading Head First Design Pattern and at chapter of Factory. I am
I was reading ActionScript 3.0 Abstract Factory Design Pattern: Multiple Products and Factories ,
reading excel files from C# working well in 32 bit version server. It is
I have a 400 pattern images at 400x300 bundled within my app. I would

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.