Hey Guys, This is the 2nd blog in the series of structural design patterns and In this blog, I am going to give one real-life example along with one coding problem and solution by using bridge pattern.

Photo by Umer Sayyam on Unsplash

Basically, In simple words Bridge pattern splits a large class into two separate hierarchies of abstraction and implementation which can be developed separately and independently.

Here, you must be confused by reading this definition, where I used tough words like abstraction and implementation, which is basically a Gang of four definitions of bridge pattern.

Don’t Panic here! After reading the following problem statement…

Hey guys, Hope you are doing good. Welcome to part 3 of the creational design pattern series i.e Factory method pattern. Let’s understand the factory method pattern in the easiest way possible by considering real-world examples.

If you not gone through Part 1 and Part 2 of the creational design pattern, you can read them here.

  1. Part One: Builder Pattern
  2. Part Two: Prototype Pattern

Problem Statement :

Let’s Suppose, You have created one vehicle booking APP, currently, user can only book a car/cab (4 wheeler) through this APP.

Hey Guys, In this blog, we will understand the GoF Builder pattern with multiple real-life examples for better clarity and we will learn ,when to use it? How to use it? Without waiting Let’s start.

Problem Statement :

Let’s discuss one common problem in our employment management app. Let’s say we need one common property i.e immutability that means once an employee is created, we don’t want to change its state.

Let’s say an employee has these properties name , age , address , phoneNo .To create the employee object, you need to provide all the parameters.

public Employee(String name,int age,String address,String phoneNo){…

Have you ever wondered!, how thread pool internally implemented in Java? Starting from the internal implementation of the thread pool, going till creating your own customizable thread pool, I will cover everything in this blog. Stay Tuned!

What is a thread pool?

Factory of threads/Group of threads aligned for important work/Family of threads.

Let me ask you an important question. Why do you need a thread pool? If you have already a Thread class and Runnable & Callable interface. You can easily create threads when required. Yes, Right!

Hold on, Just think for a moment! If you have plenty of…

Have you ever wonder, how factory design pattern is used in the Java concurrency library. I will give you a complete overview of the executer service used for creating different types of threadpools for making the developer's life easy.

Do you see here, How Java’s Executor service is only showing the utility methods to the user and hiding the complexity of creating the different types of thread pool?

Let’s understand this by using a conversation between John and Java. Let me introduce John to you. John is a programmer who is building a payment gateway that supports 1000 TPS (Transaction…

Hi Guys, This is the first blog in the Data Structure and Problem solving section of my publication. I thought of explaining data structures in a question-answer way. In this blog, step by step we will create our own custom LinkedList in JAVA.

Best Example of LinkedList in Real Life :

Kids Holding Hands an example of LinkedList

As you see in the above picture, Kids holding hands with each other is the best example of LinkedList in practical life. …

Hey Guys, This is the first blog in the behavioral design pattern series, and In this blog, I am going to give one real-life example along with one coding problem and solution by using an observer pattern.

This pattern is also known as the (Event-Subscriber or Listener) design pattern. Observer pattern gives a subscription mechanism to notify multiple objects about some event that is observed by these objects.

Photo by Daniel Lerman on Unsplash

Problem Statement :

Suppose, You want to create a blogging website like a medium, say you name it mediator and you let your users write the blog inside it and let the visitors see their…

Hey Guys, I hope you are doing well. This is the first blog in the Structural design pattern series. Let’s understand the adapter pattern in the easiest way possible by considering real-world examples.

If you have not gone through my previous blogs on creational design patterns. I suggest please go through it once.

Basically, an Adapter pattern is a structural design pattern that allows objects with incompatible types to work together and come on the same page. It is a layer that adapts between two incompatible objects.

Photo by James Lewis on Unsplash

Problem Statement :

Suppose, We have an app that gets the broadband bill from 3rd party…

Let’s understand Prototype Pattern, by solving some real-world problems by using prototype patterns.

If you have not gone through the Builder pattern i.e Part 1 of the Creational design pattern. Please go through it.

Photo by Christopher Gower on Unsplash

Problem Statement :

Let’s understand a common problem statement that can be resolved by using a prototype pattern. Suppose, you want to create an army of robots, So you first created Robot class and created one object of the Robot class, Now you want to create an exact copy of that “robot1” object.

What you will do? You will create one more object of the Robot class and copy…

Ravi Bhatt

Working as a Software Developer in Paytm. Has a 4 years of experience in total.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store