This pattern allows a client object to construct a complex object by specifying only its type and content, being shielded from the details related to the object�s representation. This way the construction process can be used to create different representations.… Continue Reading
Provide an interface to create the family of a related object of a class without exposing the creational logic. Example – Factory of Factory.
Provide an interface to create a related object of a class without exposing the creational logic. Example – Vehicle Factory – Car, Bus, Truck.
Clone or duplicate an object after costly DB operation or other costly operation. Put clone object into a HashMap. Example: Example – Costly DB Operation, Hash Mapping Suppose we are doing a sales analysis on a set of data from… Continue Reading
Sometimes it’s important to have only one instance for a class. For example, in a system, there should be only one window manager (or only a file system or only a print spooler). Usually, singletons are used for centralized management… Continue Reading