Strategy Pattern in Java

1. Overview In this tutorial, we're going to investigate the Strategy Pattern and see how we can implement it in Java. 2. When to Implement Assume ...

Continue Reading

Comparing Builder Pattern and Fluent Interface

1. Overview The builder pattern and fluent interfaces seem similar at first glance because they both use method chaining. However, their motive and...

Continue Reading

Adapter Pattern in Java

1. Overview In this tutorial, we'll look into the use cases of Adapter Pattern and how to implement it in Java. 2. When to Implement Sometimes a cl...

Continue Reading

Telescoping Constructor in Java

1. Overview In this tutorial, we'll look at the use cases of Telescoping Constructor and how to implement it. 2. When To Use Suppose that we have a...

Continue Reading

Builder Pattern using Inheritance and Generics

1. Overview Previously, we've looked at the builder pattern in its general form. The implemented builder was a public static inner class declared i...

Continue Reading

Builder Pattern in Java

1. Overview In this tutorial, we'll look at the Builder Pattern and how we can implement it in Java. 2. When to Use Let's say that we have a class ...

Continue Reading

Singleton Pattern in Java

1. Overview It's important for some classes to have exactly one instance. There can be multiple database connections, but there should be only one ...

Continue Reading

Executors

1. Overview The Executors class provides several factory methods for creating instances of ExecutorService, Callable, and others. Although the most...

Continue Reading

PausableExecutor - Executor Implementation

Executor interface in java.util.concurrent package lets you submit Runnable tasks. Executor then handles the execution of the task. This interface ...

Continue Reading

SerialExecutor - Executor Implementation

Executor interface in java.util.concurrent package lets you submit Runnable tasks. Executor then handles the execution of the task. This interface ...

Continue Reading