Kotlin Singleton with Object Declaration

In object oriented programming, there is a common situation when you want a class to have only one instance. In Java, we usually implement using the Singleton Design Pattern: define a class with a private constructor and a static field holding the only existing instance of that class. This tutorial shows you a way to implement Singleton with Kotlin Object Declaration.

[Continue reading…] “Kotlin Singleton with Object Declaration”

Chain of Responsibility Pattern in Java

Chain of Responsibility Pattern is a Behavioral Pattern in which, a Request is sent through a chain of handling Objects without knowing which Object will handle it. With Chain of Responsibility Pattern, we can avoid coupling the Sender of a request to received Objects and create a processing sequence automatically based on type of request.

[Continue reading…] “Chain of Responsibility Pattern in Java”

Facade Pattern in Java

Facade Pattern is a Structural Pattern in which, a set of interfaces is gathered into only one interface that Client can work easily and simply. Facade Pattern helps us to wrap complexities of components inside and lose coupling between Client and subSystems.

[Continue reading…] “Facade Pattern in Java”

Observer Pattern in Java

Observer Pattern is a Behavioral Pattern in which, an Object (we call it Subject) contains a list of dependency Objects (we call them Observers). Observers will be notified and updated automatically whenever Subject changes its state. Today we’re gonna look at how Observer Pattern in Java works.

[Continue reading…] “Observer Pattern in Java”

Java Design Pattern – Abstract Factory Pattern

Abstract factory pattern is a Super-Factory of a group familiar factories. We can use it to expose API for integration code and hidden the logic implementation. Abstract Factory gives us a way to manage and decouple design in case Program has more than one Factory having the same Interface.

The tutorial will guide you a sample for how to program with Abstract Factory Pattern.

[Continue reading…] “Java Design Pattern – Abstract Factory Pattern”

Java Design Pattern – Factory Pattern

Factory Pattern is a kind of Creation Pattern. Factory Pattern provides an interface for integration and hidden the complex implementation of related components.

The tutorial will help you create a factory pattern based on concept above.

[Continue reading…] “Java Design Pattern – Factory Pattern”

Java Design Pattern – Singleton Pattern

Singleton Pattern is a design pattern which you often meet in almost applications. Singleton Pattern provides a way to instantiate only one instance in an application context.

The tutorial introduces the design of Singleton Design Pattern and give many ways to create a Singleton Pattern in your application.

[Continue reading…] “Java Design Pattern – Singleton Pattern”