Home » Tag Archives: Design Patterns (page 7)

Tag Archives: Design Patterns

Fluent Object Creation

java-logo

Many posts have been written on this subject (overwhelmingly many) but I just wanted to contribute my two-cents and write a short post about how I use the Fluent Object Creation pattern or object builders in Java to instantiate Value Objects. Value Objects are abstractions that are defined by their state (value) rather than their address in memory. Examples of ...

Read More »

Using Builder Pattern in JUnit tests

junit-logo

This is not intended to be a heavily technical post. The goal of this post is to give you some guidelines to make your JUnit testing life more easy, to enable you to write complex scenarios for tests in minutes with the bonus of having extremely readable tests.                 There are two major ...

Read More »

Decorate with decorator design pattern

java-logo

Decorator pattern is one of the widely used structural patterns. This pattern dynamically changes the functionality of an object at runtime without impacting the existing functionality of the objects. In short this pattern adds additional functionalities to the object by wrapping it. Problem statement: Imagine a scenario where we have a pizza which is already baked with tomato and cheese. ...

Read More »

Facade Design Pattern – Design standpoint

java-logo

In our previous article we have described about the Adapter Design Pattern. In today’s article we are going to show about another such Gang of Four Structural patterns. As the name suggests structural pattern is used to form a larger object structure from many different objects. Façade pattern is one such pattern which provides a simplified interface to a set ...

Read More »

Gang of Four – Proxy Design Pattern

java-logo

Proxy is another Structural design pattern which works ‘on behalf of’ or ‘in place of’ another object in order to access the later. When to use this pattern? Proxy pattern is used when we need to create a wrapper to cover the main object’s complexity from the client. What are the usage scenarios? Virtual Proxy – Imagine a situation where ...

Read More »

By your Command – Command design pattern

java-logo

Command design pattern is one of the widely known design pattern and it falls under the Behavioral Design Pattern (part of Gang of Four). As the name suggests it is related to actions and events in an application.   Problem statement: Imagine a scenario where we have a web page will multiple menus in it. One way of writing this ...

Read More »

Prototype Design Pattern: Creating another dolly

java-logo

It’s really a time consuming process to create objects and also an expensive affair. So we are now on a venture to save both time and money. How do we do that? Anybody remember about Dolly? Yes, it’s the sheep which was the first mammal to be cloned. Well I don’t want to dig into the details but the key ...

Read More »

Design Patterns: Mogwai or Gremlins?

software-development-2-logo

The 1994 book Design Patterns: Elements of Reusable Object-Oriented Software introduced many software developers to the concept of ‘a catalog of simple and succinct solutions to commonly occurring design problems’ that nearly every object-oriented software developer knows of today as ‘design patterns.’ Like most technical concepts (whether real or hype or somewhere in between), ‘design patterns’ seemed to go through ...

Read More »

Design Best practices using Factory Method Pattern

java-logo

In the previous Design Pattern example we have explained about a flavor of Factory pattern which is commonly used nowadays. In this session we will understand a more advanced solution which had more abstraction. This pattern is called Factory Method design pattern. Definition: The Factory method pattern exposes a method for creating objects but delegates the object creation to the ...

Read More »

Abstract Factory Design Pattern Explained

java-logo

Abstract Factory Design Pattern is another flavor of Factory Design Pattern. This pattern can be considered as a “super factory” or “Factory of factories”. The Abstract Factory design pattern (part of the Gang of Four) falls under the Creational design pattern category and it provides a way to encapsulate a group of factories that have a common link without highlighting ...

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