Information is taken from : [Journal Dev Java Design Pattern Example Tutorial] (http://www.journaldev.com/1827/java-design-patterns-example-tutorial)
#Creational Design Patterns ###Patterns to use when an object is being instantiated
-
Singleton Pattern : Used when we want only one instance of a class. Implement using a static inner class with a private final outer class object for confirmed single instance.
-
Factory Pattern : Used when parent class has many sub class and we want an object of those classes. Implement it using a factory class which uses if elseif code for returning sub class object based on some condition and cast it to parent class (Dynamic Run time overriding)
-
Abstract Factory Pattern : Usage same as factory to remove if checks. Implement it by making abstract factory class and then its impl of base class, and all subclasses. The base class abstract impl should accept values from sub class abstract impl.