• Home
  • Docker
  • Kubernetes
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • CI
  • Install
  • Samples
  • Archived
Design Patterns | Factory Method
  1. References
  2. Example
    • The Product
    • The Concrete Product
    • The Factory
    • A simple class to test the Factory Method design pattern

  1. References
    • Definition: (source: http://en.wikipedia.org/wiki/Factory_method_pattern)

      Define an interface for creating an object, but let subclasses decide which class to instantiate.
      The Factory method lets a class defer instantiation it uses to subclasses.
  2. Example
    • The Product:


    • The Concrete Product:


    • The Factory:


    • A simple class to test the Factory Method design pattern:


© 2025  mtitek