Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 658 Bytes

File metadata and controls

19 lines (11 loc) · 658 Bytes

Factory Method Pattern

Type - Creational Pattern

Factory method pattern is a creational design pattern that provides an interface for creating objects in a superclass but allows subclasses to alter the type of objects that will be created. It is particularly useful when the exact type of the object to be created is determined at runtime.

Programming principles used in Factory Pattern :

  • Dependency Inversion prenciple states that -:
    1. Depend on abstractions, not on concrete classes.
    2. High-level modules should not depend on low-level modules. Both should depend on abstractions.

GoBack to Design Patterns