Singleton Design Pattern


Singleton is a design pattern for object construction. It falls under the category of "creational" design patterns. As the name somewhat suggests, it enables us to have one and only one instance of a class. This class will be a singleton class. In most cases, singleton objects are used to provide configuration settings or global... Continue Reading →

Advertisements

Abstract Factory Pattern – Java Code


An abstract class that declares an interface for a general ProductA. abstract class ProductA { public void method1(); public void method2(); } This below three classes provide different implementations of abstract class ProductA. The object of each of these specific implementations will be constructed in a factory class. class ProductA1 extends ProductA { String name;... Continue Reading →

Blog at WordPress.com.

Up ↑

%d bloggers like this: