In this tutorial I am going to explain about the adapter design pattern as part of the design patterns in Java series. Adapter design pattern is one of the structural design pattern because adapter design deals with how we make / structure an object. The primary problem this pattern trying to solve is to make …
Design Patterns
Builder Design Pattern
In this tutorial I am going to explain about builder design pattern, this is one of the most widely used design pattern in Java. Builder design pattern comes under the creational design pattern since builder design pattern helps in creating an object using step-by-step approach. Subscribe to our future updates. Builder design pattern solves the problem …
State Design Pattern In Java
This tutorial explains the state design pattern with a simple example program. State design pattern is very similar to the Strategy pattern, the only difference is that state design pattern maintains the state of the context where as strategy pattern passes the context and execute the specific strategy. The state design pattern is very useful …
Design Patterns in Java
In developing a system, it is expected that some requirements are guaranteed, for example, performance, robustness, understanding, ease of reuse, modification, and use. The Design Patterns were created by the architect Christopher Alexander , in the 1970s. During this period the architect wrote two books: “Pattern Language” and “Timeless Way of Building“. These books were an example of …
Lazy Initialization, Singleton Pattern and Double Checked locking
Lazy Initialization Lazy Initialization is a technique where one postpones the instantiation of a object until its first use. In other words the instance of a class is created when its required to be used for the first time. The idea behind this is to avoid unnecessary instance creation. But there are concerns related to …
Design Patterns Interview Questions
1) What is a software design pattern? A design pattern is a solution to a general software problem within a particular context. Context : A recurring set of situations where the pattern applies. Problem : A system of forces (goals and constraints) that occur repeatedly in this context. Solution : A description of communicating objects …
Decorator Design Pattern in Java
This tutorial explain the basic concept of decorator design pattern and how to use them. This is one of the pattern I have published as part of our Design pattern in Java series. If you are interested in receiving updates, please subscribe our newsletter. Intent of Decorator Design Pattern: Attach additional responsibilities to an object dynamically.Decorators …
Iterator Pattern
What is Iterator Pattern? Provide a way to access the elements of the aggregate object sequentially without exposing its underlying representation. Aggregate object is an object that contains other objects for the purpose of grouping those objects as a unit.It is also called a container or a collection.Examples are linkedList,Hashtable,ArrayList etc. also read: Design Pattern …