Mediator Design Pattern

Mediator Design Pattern defines an object that encapsulates how a set of objects interact and keeps the objects from referring to each other explicitly.

March 23, 2020

BiMap in Google Guava

The BiMap in Google Guava is a bidirectional map that preserves the uniqueness of values and keys. This allows us to lookup by value in the map too.

March 17, 2020

Memento Design Pattern

The Memento Design Pattern allows to capture and externalize an object’s internal state so that the object can be restored later without violating encapsulation

March 9, 2020

Effective Java's Builder Pattern

Introduction In the last post, I wrote about the Gang of Four (GoF) Builder Design Pattern. In this post, we will look at the builder pattern from the Effective Java…

March 2, 2020

Builder Design Pattern

The builder design pattern separates the construction of an object from its representation so that the same process can create different representations.

February 25, 2020

Multimap in Google Guava

A Multimap is a map but it can map multiple values against a key. In this post, we will look at a related class of Multiset - the Multimap in Google Guava.

February 18, 2020

Chain of Responsibility

The chain of responsibility design pattern chains the receiving objects and pass the request along the chain until an object handles it.

February 11, 2020

Multiset in Google Guava – A Complete Guide

A Multiset in Google Guava is a collection that supports order-independent equality (behaves like a Set). But it can have duplicate elements.

February 4, 2020

JMH Benchmark With Examples

JMH (Java Microbenchmark Harness) is a Java harness library for writing benchmarks on the JVM. In this post, we will learn about JVM benchmark.

January 28, 2020

Java 8 Streams Are Not Completely Lazy

Java 8 streams are lazy. The intermediate operations will not be executed till a terminal operation is invoked. But, Java 8 streams flatMap are not lazy.

January 20, 2020