Home » design patterns » Page 3

Tag Archives: design patterns

Java Mediator Design Pattern Example

Bipartite Graph

1. Introduction In this article, we are going to talk about a design pattern – Mediator Design Pattern that is widely used in various chat application(Whats App, Instagram, Facebook etc.). Mediator design pattern is  one of the design pattern that is mainly used to handle complex communications between related objects. This design pattern act as a mediator or middleman between two ...

Read More »

Java Observer Design Pattern Example

Bipartite Graph

1. Introduction In this article, we would discuss one of the numerous Java Design Patterns – The Java Observer Design pattern which is being used popularly in a variety of messaging and notification frameworks. The Observer design pattern is a typical way of managing communication between multiple classes. This pattern helps in organising the code in a way that makes ...

Read More »

Java Singleton Design Pattern Example

Bipartite Graph

1. Introduction In this article, we would be focusing on one of the many Java design patterns – The Java Singleton Design pattern with the help of a real-life example. In a massive Java application developed for a large organization, often it ends up hard to oversee and comprehend the code. With a fluctuating profile of designers taking a shot ...

Read More »

Java Bridge Design Pattern Example

Bipartite Graph

1. Introduction In this article, we would be talking about one of the many Java Design Patterns – The Bridge Design pattern. In a large scale Java application built for enterprises, at times it becomes difficult to manage and understand the code. With a varying profile of developers working on the same project, it is necessary that the code being ...

Read More »

Java Composite Design Pattern Example

Bipartite Graph

1. Introduction In this post, we feature a comprehensive Example on Java Composite Design Pattern. In a large scale Java application built for enterprises, there are certain pre-defined coding standards and structures to be followed. These standards and structures assist in development of a code that is organised and easily manageable. This also ensures that the code is structured in ...

Read More »

Java Facade Design Pattern Example

Bipartite Graph

1. Introduction In an enterprise application, it is extremely important to manage the code base so that the redundancy is reduced. Moreover, in order to make code manageable, we also need to take care that the classes are structured and connected  so that the generic code is not repeated in multiple classes. In Java, we use the features like implementing ...

Read More »

Java Adapter Design Pattern Example

Bipartite Graph

1. Introduction to design patterns A design pattern in Java is a defined implementation pattern for developing classes and objects. A design pattern provided the base to develop an architecture that reduces redundancy in the code and improves the manageability. There are numerous design patterns defined in Java. They are primarily categorised in the below categories: Creational design patterns: The ...

Read More »

Singleton Class in Java Design Pattern – Best Practices with Examples

Bipartite Graph

In this post, we feature a comprehensive Tutorial on Singleton Class in Java. Design Patterns in Java are incredibly popular among the software developers. One of the most common interview questions is the Singleton Design Pattern. So in this tutorial, I’ll summarize the best practices which will help developers dodge general issues and develop better applications. 1. What are Design ...

Read More »

Legacy-ing of systems – The causes and solutions

1. Introduction Over the years in consulting, I’ve worked with many applications. Lots of them were new developments that is the fun part of a developer’s job, but most of them were the so-called Legacy applications. What makes an application wear that ugly Legacy tag? Why do we think “Who the hell did this?” and “That is a crappy piece ...

Read More »

Java EE 6 Decorators advanced usage

Bipartite Graph

The example we’ll use is a Social media feed processor. So I have created an interface:   public interface SocialFeedProcessor { Feed process(String feed); } and provided 2 implementations, twitter and google+   public class TwitterFeedProcessor implements SocialFeedProcessor{ @Override public Feed process(String feed) { System.out.println("processing this twitter feed"); // processing logics return new Feed(feed); } } public class GooglePlusFeedProcessor implements ...

Read More »