Home » Tag Archives: Design Patterns (page 4)

Tag Archives: Design Patterns

State Design Pattern in Java – Example Tutorial

java-logo

State pattern is one of the behavioral design pattern. State design pattern is used when an Object change it’s behavior based on it’s internal state. If we have to change the behavior of an object based on it’s state, we can have a state variable in the Object and use if-else condition block to perform different actions based on the ...

Read More »

Strategy Design Pattern in Java – Example Tutorial

java-logo

Strategy pattern is one of the behavioral design pattern. Strategy pattern is used when we have multiple algorithm for a specific task and client decides the actual implementation to be used at runtime. Strategy pattern is also known as Policy Pattern. We defines multiple algorithms and let client application pass the algorithm to be used as a parameter. One of ...

Read More »

Template Method Design Pattern in Java

java-logo

Template Method is a behavioral design pattern and it’s used to create a method stub and deferring some of the steps of implementation to the subclasses. Template method defines the steps to execute an algorithm and it can provide default implementation that might be common for all or some of the subclasses. Let’s understand this pattern with an example, suppose ...

Read More »

Visitor Design Pattern in Java – Example Tutorial

java-logo

Visitor Pattern is one of the behavioral design pattern. Visitor pattern is used when we have to perform an operation on a group of similar kind of Objects. With the help of visitor pattern, we can move the operational logic from the objects to another class. For example, think of a Shopping cart where we can add different type of ...

Read More »

Mediator Design Pattern in Java – Example Tutorial

java-logo

Mediator Pattern is one of the behavioral design pattern, so it deals with the behaviors of objects. Mediator design pattern is used to provide a centralized communication medium between different objects in a system. According to GoF, mediator pattern intent is: Allows loose coupling by encapsulating the way disparate sets of objects interact and communicate with each other. Allows for ...

Read More »

Memento Design Pattern in Java – Example Tutorial

java-logo

Memento pattern is one of the behavioral design pattern. Memento design pattern is used when we want to save the state of an object so that we can restore later on. Memento pattern is used to implement this in such a way that the saved state data of the object is not accessible outside of the object, this protects the ...

Read More »

Observer Design Pattern in Java – Example Tutorial

java-logo

Observer pattern is one of the behavioral design pattern. Observer design pattern is useful when you are interested in the state of an object and want to get notified whenever there is any change. In observer pattern, the object that watch on the state of another object are called Observer and the object that is being watched is called Subject. ...

Read More »

Iterator Design Pattern in Java – Example Tutorial

java-logo

Iterator pattern in one of the behavioral pattern and it’s used to provide a standard way to traverse through a group of Objects. Iterator pattern is widely used in Java Collection Framework where Iterator interface provides methods for traversing through a collection. According to GoF, iterator design pattern intent is: Provides a way to access the elements of an aggregate ...

Read More »

Design Patterns: State

java-logo

This article will be about State design pattern. It is one of behavioral design patterns. You don’t need to know many theory to understand the main concepts of the pattern. The post will be break in several parts where I will provide information about situations where the pattern need to be applied, cons and pros which it has and an ...

Read More »

Design Patterns after Design is Done

software-development-2-logo

Design Patterns are a useful tool when you are designing a system, an effective shorthand for communicating and sharing design ideas and a way to build consistency into the code – if people understand them and follow patterns properly. I’m not interested in arguments over whether design patterns are good or not, or which patterns are good and which ones ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close