Delegation Pattern in Kotlin 1. Overview There are many use cases in which delegation is preferred to inheritance. Kotlin has great language-level support for this. In this tutorial, we’ll talk about Kotlin’s native support for the delegation pattern and see it in action. 2. Implementation First, let’s assume we have… Continue Reading kotlin-delegation-pattern

Composite Design pattern in Java 1. Introduction In this quick tutorial, we’ll introduce the composite design pattern in Java. We’re going to describe the structure and the purpose of its use. 2. The Structure The composite pattern is meant to allow treating individual objects and compositions of objects, or “composites” in… Continue Reading java-composite-pattern

Lombok @Builder with Inheritance 1. Overview The Lombok library provides a great way to implement the Builder Pattern without writing any boilerplate code: the @Builder annotation. In this short tutorial, we’re specifically going to learn how to deal with the @Builder annotation when inheritance is involved. We will demonstrate two techniques.… Continue Reading lombok-builder-inheritance

A Guide to the Front Controller Pattern in Java 1. Overview In this tutorial we’ll be digging deeper into the Front Controller Pattern, part of the Enterprise Patterns as defined in Martin Fowler‘s book “Patterns of Enterprise Application Architecture”. Front Controller is defined as “a controller that handles all requests… Continue Reading java-front-controller-pattern