Factory class Design Pattern Program

This “Factory class Design Pattern example” page is providing how to implement factory design pattern using interface and their implementations.

core-java-online-training-2

Factory design pattern:

  1. Following application consists of interfaces and classes to describe factory design patter.
  2. Interface is a set of specifications represents “Mobile” object.
  3. We have 2 implementations for this Mobile interface such as “Samsung” and “Android”.
  4. “MobileFactory” class returns instance of Mobile on request.
  5. “MobileFactoryDemo” class is the main class to run and understand the design pattern.

core-java-online-training-2

Share this