none
Defintion of Factory Method Design Pattern is confusing ... Please help me to understand it RRS feed

  • Question

  • Hi ,

    Even though i understand the factory method code in all the website but i dont understand the below definition

    Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.

    Some one could help me understaing ..

    I have taken the below from DoFactory

    Product  -- is this the interface which refers in the above definition?
    ConcreteProduct
    Creator
    ConcreteCreator 

    Which one of the above is refered as SubClasses?

    What does it "Factory Method lets a class defer instantiation to subclasses" mean?


    ilikemicrosoft

    Monday, February 10, 2014 6:39 AM

All replies

  • That's not quite my understanding of a factory, basically you ask the factory for an instance of an type and it provides one based on some set of criteria. Sure you can involve interfaces but that's an implementation choice

    http://pauliom.wordpress.com

    Sunday, February 16, 2014 9:33 PM