Observer Pattern Java Support

1. Overview In this tutorial, we'll investigate Java's built-in support for the observer pattern. When we try to implement the observer pattern, we...

Continue Reading

Observer Pattern in Java

1. Overview The Observer pattern allows us to establish a communication channel between two parties: the subject and observer. It's also known as t...

Continue Reading

Decorator Pattern with Lombok @Delegate

1. Overview In this tutorial, we'll look at how we can apply the decorator pattern using Lombok's @Delegate annotation. 2. Why Use @Delegate? Let's...

Continue Reading

Forwarding Reusable Decorators

1. Code Reuse with Multiple Decorators? In this tutorial, we're going to look at how we can use forwarding decorators to enable code reuse when we ...

Continue Reading

Decorator Pattern in Java

1. Overview There are mainly two ways to add new responsibility to a class: inheritance and composition. With inheritance, we rely on the subclasse...

Continue Reading

Task: Secure a Service Using Java Dynamic Proxy

1. Task In this task, we 'll explore the Java dynamic proxy mechanism. In essence, we'll secure an application service using the JDK dynamic proxie...

Continue Reading

Securing a Service using Proxy Pattern

1. Overview In this article, we'll secure an existing service using the proxy pattern. We'll perform the authorization checks according to the curr...

Continue Reading

Caching a Service using Proxy Pattern

1. Overview In this tutorial, we'll introduce caching to an existing service using the proxy pattern. So the service calls will return the cached r...

Continue Reading

Proxy Pattern in Java

1. Overview In this tutorial, we'll examine the use cases of the Proxy Pattern and how we can implement it in Java. 2. When To Use A proxy is a sur...

Continue Reading

Strategy Pattern, Stateless or Stateful?

1. Overview Should strategy classes be stateless or stateful? This is a question related to API design and may have different meanings for differen...

Continue Reading