Visitor Design Pattern explained with simple example

The visitor design pattern allows a programmer to separate algorithms of the module from the object or class. This will allow to modify algorithm by adding or removing new functionalities without altering objects structure. This design pattern basically allows us to add a functionality to every element without altering their structure.

Before going ahead have a look at Design pattern simplified version.

(more…)
Visitor Design Pattern explained with simple example Read More

State Design Pattern explained with simple example

State design pattern allows an object to change its behaviour whenever its state changes. This design pattern is very similar to state machines in which behaviour of an object based on an event is dependent on the its state. This design pattern makes the software easily extensible as adding new states are quite easy because it doesn’t affect the behaviour of existing states.

Before going ahead have a look at Design pattern simplified version.

(more…)
State Design Pattern explained with simple example Read More

Observer Design Pattern explained with simple example

Observer design pattern is one of the most famous and widely used design pattern in software industry. In this design pattern basically multiple objects which are called as observers, registers themselves to an object called as subject for getting automatic notifications, whenever any state changes occurs in subject. This is mainly used for event handling modules.

Before going ahead have a look at Design pattern simplified version.

(more…)
Observer Design Pattern explained with simple example Read More

Memento Design Pattern explained with simple example

The Memento design pattern basically stores the various states of the system and provides the ability to restore the system in some previous state. This design pattern allows software to storing store various state which can be used for retracing or can be used to go back to some previous state in case something goes wrong. Also, auditing related procedures also can be done using this design pattern.

Before going ahead have a look at Design pattern simplified version.

(more…)
Memento Design Pattern explained with simple example Read More

Mediator Design Pattern explained with simple example

Mediator design pattern basically defines an interface class which provides a mechanism for providing communication between various modules/components of the software. Since, mediator needs to access each component of the software, which means it should be added as a reference in each component. Using this mediator class components becomes less dependent on each other which means coupling is reduced.

Before going ahead have a look at Design pattern simplified version.

(more…)
Mediator Design Pattern explained with simple example Read More

Iterator Design Pattern explained with simple example

An iterator is an object which allows a developer to easily traverse through a container class. The Iterator design pattern is relatively simple and easy to implement kind of design pattern in which an iterator is used to traverse through a complex container in order to access the elements of the container. This design pattern tries to decouple container classes from the other modules in order to achieve low coupling.

Before going ahead, have a look at Design pattern simplified version.

(more…)
Iterator Design Pattern explained with simple example Read More

Interpreter Design Pattern explained with simple example

Interpreter design pattern is mainly used in compiler and other language processing programs. This design pattern used to identify various language mainly textual such as numbers, regular expression etc. This design pattern interprets every language syntax and assign a class accordingly, to do further processing.

Before going ahead have a look at Design pattern simplified version.

(more…)
Interpreter Design Pattern explained with simple example Read More

Command Design Pattern Explained With Simple Example: Behavioural Design Pattern Category

The Command design pattern allows to encapsulate an action or trigger inside an object which will be used later to trigger an event. Since in this design pattern, commands are encapsulated inside objects, hence we can use additional actions on this commands for example- Queuing of various commands, undo/redo actions etc. This design pattern is very useful in case of GUI actions (button, menu actions etc), transactional behaviour, progress bars etc. For Design patterns basic explanation see (Design Patterns Simplified Version).

(more…)

Command Design Pattern Explained With Simple Example: Behavioural Design Pattern Category Read More

Chain-of-Responsibility Design Pattern Explained With Simple Example: Behavioural Design Pattern Category

The Chain-of-Responsibility design pattern basically consists of a source of command objects and a hierarchical series of processing objects. Every processing unit will process only typical kind of commands and it will pass rest of the command to next processing unit, thus creating a chain of processing units and that’s why the name of this design pattern is Chain-of-Responsibility pattern. This pattern provides the idea of one of the best programming practice which is “loose coupling”. For Design patterns basic explanation see (Design Patterns Simplified Version).

(more…)

Chain-of-Responsibility Design Pattern Explained With Simple Example: Behavioural Design Pattern Category Read More

OOPS Design Patterns Simplified Version

Design pattern describes solutions to a problem which arises while developing software for a specific condition. Design patterns are basically independent of any programming language. Lot of guys do the mistake of thinking it as an algorithm but its a common way to solve a generic problem which can be simple or complex.

Basically there are three different categories of design patterns depending on the problem they address:

  • Creational Patterns
  • Structural Patterns
  • Behavioural Patterns
(more…)
OOPS Design Patterns Simplified Version Read More