DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Curious about the future of data-driven systems? Join our Data Engineering roundtable and learn how to build scalable data platforms.

Data Engineering: The industry has come a long way from organizing unstructured data to adopting today's modern data pipelines. See how.

Threat Detection: Learn core practices for managing security risks and vulnerabilities in your organization — don't regret those threats!

Managing API integrations: Assess your use case and needs — plus learn patterns for the design, build, and maintenance of your integrations.

Core Badge
Avatar

Brijesh Saxena

DZone Core CORE

Solution Architect, Software Designer, Developer, Mentor, Trainer, Blogger, Guide at Infor Global Solutions, Inc.

New York, US

Joined Sep 2017

https://brijeshksaxena.wordpress.com/

About

Transforming business by design. A passionate software professional who loves to contribute in the technology and share experience and ideas with fellow professionals. https://github.com/BrijeshSaxena https://brijeshksaxena.wordpress.com/ @ImBrijeshSaxena https://www.facebook.com/imbrijeshsaxena/

Stats

Reputation: 2391
Pageviews: 1.3M
Articles: 26
Comments: 94
  • Articles
  • Comments

Articles

article thumbnail
Getting Started With JMS-ActiveMQ: Explained in a Simple Way
Want to learn Java Message Service using ActiveMQ? Here is the article to explain the basics with simple examples and setup.
January 4, 2023
· 18,789 Views · 5 Likes
article thumbnail
Memento Design Pattern In Java
Another behavioral design pattern called the Memento Design Pattern which is used to restore the state of an object to a previous state.
Updated November 5, 2020
· 14,109 Views · 8 Likes
article thumbnail
Using the Chain of Responsibility Design Pattern in Java
The Chain of Responsibility pattern allows a number of classes to attempt to handle a request independently.
November 2, 2020
· 20,446 Views · 6 Likes
article thumbnail
Using Template Method Design Pattern In Java
Today, I will discuss another very useful design pattern named the Template Method Design Pattern. Read on to find out more!
October 30, 2020
· 9,650 Views · 4 Likes
article thumbnail
Using Interpreter Design Pattern In Java
The Interpreter Design Pattern is one of the Gang of Four design patterns which specifies how to evaluate sentences in a language.
October 29, 2020
· 8,112 Views · 3 Likes
article thumbnail
Using Filter Design Pattern In Java
How to use filter design pattern in Java—also known as Criteria Design Pattern, which is a structural pattern that combines multiple criteria to obtain single criteria.
October 22, 2020
· 23,682 Views · 7 Likes
article thumbnail
Using Flyweight Design Pattern In Java
In this article, explore the Flyweight design pattern in Java.
October 22, 2020
· 7,733 Views · 6 Likes
article thumbnail
Command Design Pattern In Java
Here, we'll discuss the Command Design Pattern — a useful pattern in which we wrap a request in an object known as Command and give it an Invoker to perform.
Updated October 22, 2020
· 7,147 Views · 6 Likes
article thumbnail
Using Proxy Design Pattern In Java
Today, I will discuss another structural design pattern - Proxy Design Pattern. Proxy means an object functioning as another object.
October 20, 2020
· 11,481 Views · 13 Likes
article thumbnail
Composite Design Pattern in Java
Want to learn more about the composite design pattern in Java? Take a look at this tutorial to learn how to implement this design pattern in your project.
Updated October 20, 2020
· 63,007 Views · 18 Likes
article thumbnail
State Design Pattern In Java
State Design Pattern — a behavioral design pattern that allows an object to change its behavior when its internal state changes.
October 19, 2020
· 5,019 Views · 6 Likes
article thumbnail
Builder Design Pattern In Java
The Builder design pattern is designed to provide a flexible solution to various object creation problems in object-oriented programming.
Updated October 15, 2020
· 10,230 Views · 8 Likes
article thumbnail
Visitor Design Pattern In Java
The Visitor design pattern lets us separate algorithms from the objects on which they operate. See how to implement it to follow the open/closed principle.
October 13, 2020
· 7,393 Views · 16 Likes
article thumbnail
Observer Design Pattern In Java
Observer Pattern maintains a one-to-many dependency between a Subject and its dependents so that when the state of the Subject changes, dependents get notified.
October 12, 2020
· 11,860 Views · 4 Likes
article thumbnail
Iterator Design Pattern In Java
The Iterator Pattern is a relatively simple behavioral design pattern that provides a simple way to iterate through the collection of objects.
October 12, 2020
· 11,142 Views · 5 Likes
article thumbnail
Facade Design Pattern In Java
Here I am with another article on design patterns. A Facade object is use to provide a simple interface by hiding complexities of a complex system.
October 6, 2020
· 10,916 Views · 8 Likes
article thumbnail
Abstract Factory Pattern In Java
In this article, I will try to highlight the usage of the Abstract Factory Pattern along with the difference with the Factory Pattern.
October 5, 2020
· 10,790 Views · 8 Likes
article thumbnail
Using the Adapter Design Pattern in Java
Want to learn more about using the adapter design pattern in Java? Check out this tutorial to learn how to use the object, class, and two ways adapter patterns.
August 28, 2018
· 142,505 Views · 30 Likes
article thumbnail
Java Enums: How to Use Configurable Sorting Fields
Want to learn more about how to use Java enums with configurable sorting fields? Check out this tutorial to learn more about using enums with sorting fields.
Updated August 27, 2018
· 30,064 Views · 16 Likes
article thumbnail
Using the Bridge Design Pattern in Java
Want to learn more about design patterns in Java? Check out this post to learn more about how to use the bridge design pattern in this tutorial.
August 27, 2018
· 48,565 Views · 19 Likes
article thumbnail
Strategy vs. Factory Design Patterns in Java
Want to learn more about using strategy and factory patterns in Java? Check out this tutorial to learn how to use both on your next project!
August 24, 2018
· 79,953 Views · 23 Likes
article thumbnail
Decorator Design Pattern in Java
Want to learn more about using the decorator design pattern in Java? Check out this example using the Shape class to learn how.
August 23, 2018
· 151,929 Views · 43 Likes
article thumbnail
Null Object Pattern in Java
Want to learn more about using the null object pattern in Java? Check out this tutorial to learn how to use the null object pattern with the optional class!
August 22, 2018
· 88,514 Views · 47 Likes
article thumbnail
Singleton Design Pattern: Making Singleton More Effective in Java
Want to learn more about when to use the singleton design pattern in Java? Check out this post on the singleton pattern and its usage as a properties holder.
August 3, 2018
· 24,199 Views · 8 Likes
article thumbnail
Java Enums: How to Make Enums More Useful
Having trouble using enums in Java? Check out this post to learn more about how to make enums more useful with or without a set of variables.
August 2, 2018
· 232,218 Views · 34 Likes
article thumbnail
How to Use Singleton Design Pattern in Java
There are several ways to use the singleton design pattern. Check out this post on how to use the singleton design pattern through four different methods.
Updated July 20, 2018
· 223,303 Views · 38 Likes

Comments

Getting Started With JMS-ActiveMQ: Explained in a Simple Way

Jan 05, 2023 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena


Getting Started With JMS-ActiveMQ: Explained in a Simple Way

Jan 05, 2023 · Brijesh Saxena

Liked the article? Please don't forget to press on like button. :) Happy coding!

Getting Started With JMS-ActiveMQ: Explained in a Simple Way

Jan 05, 2023 · Brijesh Saxena

Source code could be found here: JMS-ActiveMQ

NullPointerException in Java: Causes and Ways to Avoid It

Jan 12, 2022 · Dmitry Egorov

Agreed with Ilya Matveev. still we do not have any great library to handle Nulls. Optional is a good. But we need lots of improvements in that. Overall, its good article on NullPointerException. Thanks.

Using Filter Design Pattern In Java

Sep 20, 2021 · Brijesh Saxena

Thanks Manali. Appreciated. I have corrected the OrFilter and committed the updated code as well into the repository. Kindly pull the latest code to give a try. Thanks :)

Using Proxy Design Pattern In Java

Nov 07, 2020 · Brijesh Saxena

Thanks for the review. Appreciated. :)

Memento Design Pattern In Java

Nov 05, 2020 · Brijesh Saxena

Thanks for pointing that. Will get it corrected.


Using Template Method Design Pattern In Java

Nov 04, 2020 · Brijesh Saxena

Thanks for the review. Appreciated. Few points:

1) Inheritance is used to have different types of car manufacturing.

2) Unused setter/getter are provided to avoided for less experience audience; They may think immutable object is required to implement the pattern. For highly experience and genius like you the articles on design patterns are not required at all. :)

3) To make the example short and simple, I used "setters" as "operations" for template. I can also expand the example by using detailed operations like fixEngine(), fixWheels(), fixSeats() instead of just a setter. But, that will make the example lengthier.

Fix word is used to set the object. So, if some implementation does not do that? I think we need to do Null checks which normally many of us do not like do everywhere (only for 3rd party libraries or until its really needed). Also, it will be very hard to write a full proof example if the intension is to do negative programming just to break the code and not to learn the idea.

4) "do not use" ? Yeap. Agreed. In fact I never get a chance to use this pattern. May be thats the reason my example is not that good (reused Builder Design Pattern example). I wrote the article just to cover all basic articles as a start.

At the end, I will not write "do not use" since you already written that in comments.

I noted all the points you gave and I will try to find some better example for you.

Thanks for spending time on my article.

Using the Chain of Responsibility Design Pattern in Java

Nov 03, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena


Using the Chain of Responsibility Design Pattern in Java

Nov 03, 2020 · Brijesh Saxena

Liked the article? Please don't forget to press on like button. :)

Using the Chain of Responsibility Design Pattern in Java

Nov 03, 2020 · Brijesh Saxena

The Source Code can be found here: Chain-of-Responsibility-Design-Pattern-Sample-Code

Using Template Method Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Using Template Method Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Liked the article? Please don't forget to press on like button. :)

Using Template Method Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Source Code can be found here: Template-Method-Design-Pattern-Source-Code

Using Proxy Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Command Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Using Flyweight Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Using Filter Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Builder Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Composite Design Pattern in Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

State Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Memento Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Visitor Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Observer Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Facade Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Java Enums: How to Use Configurable Sorting Fields

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Using the Adapter Design Pattern in Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Using the Bridge Design Pattern in Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Strategy vs. Factory Design Patterns in Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Decorator Design Pattern in Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Null Object Pattern in Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Java Enums: How to Make Enums More Useful

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

How to Use Singleton Design Pattern in Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena

Using Interpreter Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Liked the article? Please don't forget to press on like button :)


Using Interpreter Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

Need more articles, please visit my profile: Brijesh Saxena


Using Interpreter Design Pattern In Java

Oct 30, 2020 · Brijesh Saxena

The Source Code can be found here: Interpreter-Design-Pattern-Sample-Code

Visitor Design Pattern In Java

Oct 24, 2020 · Brijesh Saxena

Yes, even I am waiting to get language level visitor pattern in java. Using Element word to make it sync with other articles on the visitor pattern.

Builder Design Pattern In Java

Oct 24, 2020 · Brijesh Saxena

thanks :)

Composite Design Pattern in Java

Oct 24, 2020 · Brijesh Saxena

thanks :)

Visitor Design Pattern In Java

Oct 23, 2020 · Brijesh Saxena

Agreed and aware of. I avoided using BigDecimal to keep the example simple and not even confusing for less experience audience.

Using Flyweight Design Pattern In Java

Oct 22, 2020 · Brijesh Saxena

Liked the article? Please don't forget to press on like button. :)

Using Filter Design Pattern In Java

Oct 22, 2020 · Brijesh Saxena

Liked the article? Please don't forget to press on like button. :)

Using Flyweight Design Pattern In Java

Oct 22, 2020 · Brijesh Saxena

Source code can be found here: Flyweight Design Pattern Sample Code

Using Filter Design Pattern In Java

Oct 22, 2020 · Brijesh Saxena

Source Code can be found here: Filter-Design-Pattern-Source-Code

Using Proxy Design Pattern In Java

Oct 20, 2020 · Brijesh Saxena

Liked the article? Please don't forget to press on like button. :)

Using Proxy Design Pattern In Java

Oct 20, 2020 · Brijesh Saxena

The Source Code can be found here: Proxy-Design-Pattern-Sample-Code

State Design Pattern In Java

Oct 19, 2020 · Brijesh Saxena

Liked the article? Please don't forget to press on like button. :)

State Design Pattern In Java

Oct 19, 2020 · Brijesh Saxena

Source Code can be found here: State-Design-Pattern-Sample-Code


Memento Design Pattern In Java

Oct 16, 2020 · Brijesh Saxena

Liked the article? Please don't forget to press on like button. :) Happy coding!

Memento Design Pattern In Java

Oct 16, 2020 · Brijesh Saxena

Source Code can be found here: Memento-Design-Pattern-Sample-Code

Visitor Design Pattern In Java

Oct 13, 2020 · Brijesh Saxena

Liked the article? Please don't forget to press on like button. :)

Visitor Design Pattern In Java

Oct 13, 2020 · Brijesh Saxena

Source Code can be found here: Visitor-Design-Pattern-Sample-Code

Iterator Design Pattern In Java

Oct 13, 2020 · Brijesh Saxena

Liked this article? Don't forget to press on like button. :)

Iterator Design Pattern In Java

Oct 13, 2020 · Brijesh Saxena

Source Code can be found here: Iterator Design Pattern Source Code

Observer Design Pattern In Java

Oct 13, 2020 · Brijesh Saxena

Liked the article? Please don't forget to press on like button. :)

Observer Design Pattern In Java

Oct 13, 2020 · Brijesh Saxena

Source Code can be found here: Observer Design Pattern Sample Code

Facade Design Pattern In Java

Oct 06, 2020 · Brijesh Saxena

Liked the article? Please don't forget to press that like button. :)

Facade Design Pattern In Java

Oct 06, 2020 · Brijesh Saxena

Source Code can be found here: Facade-Design-Pattern-Sample-Code

Abstract Factory Pattern In Java

Oct 06, 2020 · Brijesh Saxena

Liked the article? Please don't forget to press that like button. :)


Abstract Factory Pattern In Java

Oct 06, 2020 · Brijesh Saxena

Source Code can be found here: Abstract-Factory-Design-Pattern-Sample-Code

Builder Design Pattern In Java

Oct 06, 2020 · Brijesh Saxena

Liked the article? Please don't forget to press that like button. :)


Builder Design Pattern In Java

Oct 06, 2020 · Brijesh Saxena

Source Code can be found here: Real-Builder-Design-Pattern-Source-Code

and Builder-Design-Pattern-Sample-Code

Command Design Pattern In Java

Oct 01, 2020 · Brijesh Saxena

Liked the article? Please don't forget to click like button as well :)


Command Design Pattern In Java

Oct 01, 2020 · Brijesh Saxena

Source Code can be found here: https://dzone.com/articles/command-design-pattern-in-java

Composite Design Pattern in Java

Sep 21, 2020 · Brijesh Saxena

Thanks :) You may visit to my profile https://dzone.com/users/3094163/brijeshsaxena.html to find some more articles on design patterns.

How to Use Singleton Design Pattern in Java

Sep 13, 2020 · Brijesh Saxena

https://github.com/BrijeshSaxena/design-pattern-singleton

Null Object Pattern in Java

Sep 12, 2020 · Brijesh Saxena

https://github.com/BrijeshSaxena/design-pattern-nullobject

Java Enums: How to Use Configurable Sorting Fields

Sep 12, 2020 · Brijesh Saxena

https://github.com/BrijeshSaxena/design-java-enums-sorting

Java Enums: How to Make Enums More Useful

Sep 12, 2020 · Brijesh Saxena

https://github.com/BrijeshSaxena/design-java-enums

Strategy vs. Factory Design Patterns in Java

Aug 31, 2020 · Brijesh Saxena

https://github.com/BrijeshSaxena/design-pattern-strategy And https://github.com/BrijeshSaxena/design-pattern-factory

Decorator Design Pattern in Java

Aug 31, 2020 · Brijesh Saxena

https://github.com/BrijeshSaxena/design-pattern-decorator

Using the Bridge Design Pattern in Java

Aug 31, 2020 · Brijesh Saxena

https://github.com/BrijeshSaxena/design-pattern-bridge

Using the Adapter Design Pattern in Java

Aug 31, 2020 · Brijesh Saxena

https://github.com/BrijeshSaxena/design-pattern-adapter

Composite Design Pattern in Java

Aug 31, 2020 · Brijesh Saxena

https://github.com/BrijeshSaxena/design-pattern-composite/tree/master/composite

Using the Bridge Design Pattern in Java

Aug 31, 2020 · Brijesh Saxena

Agreed. But just to keet the example simple and not to make audience any confusion, I avoid using AbstractFactory into this example. I will cover that in another article separately.

Java Enums: How to Make Enums More Useful

Jan 28, 2019 · Brijesh Saxena

Thanks for pointing this. Corrected. :)

Composite Design Pattern in Java

Aug 30, 2018 · Brijesh Saxena

Liked the article? Please don't forget to click like button as well :)

Using the Adapter Design Pattern in Java

Aug 28, 2018 · Brijesh Saxena

Liked the article? Please don't forget to click like button as well :)

Using the Bridge Design Pattern in Java

Aug 27, 2018 · Brijesh Saxena

Liked the article? Please don't forget to click like button :)

Strategy vs. Factory Design Patterns in Java

Aug 24, 2018 · Brijesh Saxena

Liked the article? Please don't forget to click like button :)

Null Object Pattern in Java

Aug 24, 2018 · Brijesh Saxena

I thought its well understood.

Null Object Pattern in Java

Aug 24, 2018 · Brijesh Saxena

Sorry to hear that. The article https://dzone.com/articles/strategy-vs-factory-design-pattern-in-java is available now. Please have a look :)

Decorator Design Pattern in Java

Aug 23, 2018 · Brijesh Saxena

Liked the article? Please don't forget to click like button :)

Null Object Pattern in Java

Aug 22, 2018 · Brijesh Saxena

Liked the article? Please don't forget to click like button :)

Java Enums: How to Use Configurable Sorting Fields

Aug 15, 2018 · Brijesh Saxena

Liked the article? Please don't forget to click like button as well :)

Singleton Design Pattern: Making Singleton More Effective in Java

Aug 05, 2018 · Brijesh Saxena

In the examples of this article I have implemented Serializable and Clonable to demonstrate how you can make serilization and coning support on your Singleton class. So, any accidental misuse of the Singleton class via serialization or cloning is handled.

Still the example is not supported or proof for Reflection as I indicated as well. For reflection use Enums.

Singleton Design Pattern: Making Singleton More Effective in Java

Aug 03, 2018 · Brijesh Saxena

Liked the article? Please don't forget to click like button :)

How to Use Singleton Design Pattern in Java

Aug 03, 2018 · Brijesh Saxena

Like to know more on Singletons? Visit my another article Singleton making more effective

How to Use Singleton Design Pattern in Java

Aug 03, 2018 · Brijesh Saxena

Liked the article? Don't forget to click on like button :)

Java Enums: How to Make Enums More Useful

Aug 03, 2018 · Brijesh Saxena

Liked the article? Don't forget to click on like button :)

How to Use Singleton Design Pattern in Java

Jul 24, 2018 · Brijesh Saxena

OK. the article was not about singleton vs no singleton. It was only about how to use. But your suggestion make sense. I will try to add a section on this as well soon.

How to Use Singleton Design Pattern in Java

Jul 24, 2018 · Brijesh Saxena

I see. I will add the correction of the approach just below the example. Will that be OK for you?

How to Use Singleton Design Pattern in Java

Jul 23, 2018 · Brijesh Saxena

Just to indicate the issue with the 1st approach. I have seen many good programmers coding lazy intialization without thinking for double locking.

How to Use Singleton Design Pattern in Java

Jul 23, 2018 · Brijesh Saxena

We should use lazy loding method with double lock. Will add an example soon.

User has been successfully modified

Failed to modify user

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: