Category: Other Tutorials

Other Tutorials

State Design Pattern In Java

Introduction: In this tutorial, we’ll explore another popular behavioral design pattern – the State Design Pattern. The knowledge of state design pattern comes handy when we’re working with an object which can exist in multiple states. We should use it primarily when the behavior of an object depends on its current state. This pattern helps […]

Be the First to comment. Read More
Other Tutorials

Template Method Pattern In Java

Introduction: The template method pattern is a behavioral pattern which suggests defining an algorithm more generally in the superclass. The algorithm is defined within a method known as the template method. The subclasses only define the implementation of the more specific algorithmic steps. The benefit of using this design pattern is that any changes later […]

Be the First to comment. Read More
Other Tutorials

Decorator Design Pattern In Java

Introduction: A decorator design pattern allows dynamically attaching the additional responsibilities or behaviors to an object at runtime. It is a structural pattern and makes use of aggregation to combine those behaviors. In this tutorial, we’ll learn to implement the decorator pattern. UML Diagram: Let’s start by looking at the UML representation of a decorator […]

One comment Read More
Other Tutorials

Proxy Design Pattern In Java

Introduction: Proxy objects or the surrogates provide a placeholder for another object to control access to that object. A proxy acts as a lightweight or the simplified version of the original object. It supports the same operations as the original object but may delegate those requests to the original object to achieve them. The Proxy […]

Be the First to comment. Read More
Other Tutorials

Factory Method Design Pattern

Introduction: Factory Method pattern is one of the popular creational design patterns. It doesn’t specifically rely on a factory object to create the objects. Rather, the idea is to use a separate method in the same class to create an object. Factory Method pattern defines an interface for creating objects but lets the subclasses decide […]

One comment Read More
Other Tutorials

Facade Design Pattern In Java

Introduction: Facade means the face of a building. While passing across a street, all we look at is the face of a building. The face abstracts all the complex implementation details of a building. Similarly, a facade design pattern aims to provide a unified interface to a set of interfaces in the subsystem. This unified […]

Be the First to comment. Read More
Other Tutorials

Composite Design Pattern In Java

Introduction: A composite design pattern is useful when we have to work with a tree-like hierarchical structure of objects. It lets us treat the individual objects and the composition of objects uniformly. It falls under the category of a structural design pattern as it composes objects into a tree structure to represent part-whole hierarchies. UML […]

Be the First to comment. Read More
Other Tutorials

Adapter Design Pattern In Java

Introduction: The Adapter design pattern is a structural design pattern that helps us to connect to the legacy or third-party code that exposes a similar functionality through a different interface. A real-world analogy for an adapter is the one we use to connect our USB cable to an ethernet port. While designing an object-oriented application, […]

Be the First to comment. Read More
Other Tutorials

Creating Custom Maven Archetype

Introduction: Maven archetypes are the project templates which can help us quickly create a maven starter project based on its type. It’s a great tool to bootstrap a maven project with least effort. There are wide options of archetypes available to us. Some of the popular archetypes include – maven-archetype-quickstart, maven-archetype-webapp, maven-archetype-archetype. To create a […]

3 comments Read More
Other Tutorials

Maven Dependency Scopes

Introduction: Managing dependencies is a core feature of Maven. When defining a maven dependency, the scope attribute defines the visibility of that dependency on different maven lifecycle phases such as build, test and run. The dependency scopes limit the transitivity of dependencies in any project, thereby affecting the classpath. Also, there are six different available […]

3 comments Read More