Singleton Pattern In Java
The Singleton Pattern in Java ensures a class has only one instance, and provides a global point of access to it. Before getting into implementing Singleton Pattern, let’s go through few questions to make you understand the pattern better. public class MyClass { private MyClass()…
Abstract Factory Pattern In Java
The Abstract Factory Pattern in Java provides an interface for creating families of related or dependent objects without specifying their concrete classes. For better understand of the pattern, take a look at my previous article about Factory Method Pattern Abstract Factory Pattern = Factory Method…
Factory Method Pattern In Java
We are going to look at making objects than just using the new operator. Factory Method Pattern in Java can help you save from embarrassing dependencies. Factory Method Pattern The Factory Method Pattern defines an interface for creating an object, but lets subclasses decide which class…
Decorator Pattern in Java
What is Decorator Pattern? The Decorator pattern in Java is defined as it attaches additional responsibilities to an object dynamically. Decorator pattern provides a flexible alternative to subclassing for extending functionality. A problem to understand the need to implement Decorator Pattern in Java A Dominico’s…
Observer Pattern In Java – Part II
An Overview to Understand Observer Pattern in Java You know how newspaper or magazine subscriptions work: A newspaper publisher goes into business and begins publishing newspapers. You subscribe to particular publisher, and every time there’s a new edition it gets delivered to you. As long…
Observer Pattern In Java – Part I
An Overview to Understand Observer Pattern in Java You know how newspaper or magazine subscriptions work: A newspaper publisher goes into business and begins publishing newspapers. You subscribe to particular publisher, and every time there’s a new edition it gets delivered to you. As long…
Strategy Pattern in Java
What is Strategy Pattern in Java? It defines a family of algorithms, encapsulates each one, and make them interchangeable. Strategy lets the algorithms vary independently from clients that use it. A problem to understand the need to implement Strategy Pattern in Java A Robot manufacturing…
What is Design Pattern?
Design pattern is a general design that anyone can apply which resolves the goal and set of constraints that occur in recurring situation while designing the programming for software. Luckily, patterns are not described and documented as a simple problem and solution. We have much…