Solution Architect, Software Designer, Developer, Mentor, Trainer, Blogger, Guide at Infor Global Solutions, Inc.
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 |
Comments
Jan 05, 2023 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Jan 05, 2023 · Brijesh Saxena
Liked the article? Please don't forget to press on like button. :) Happy coding!
Jan 05, 2023 · Brijesh Saxena
Source code could be found here: JMS-ActiveMQ
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.
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 :)
Nov 07, 2020 · Brijesh Saxena
Thanks for the review. Appreciated. :)
Nov 05, 2020 · Brijesh Saxena
Thanks for pointing that. Will get it corrected.
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.
Nov 03, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Nov 03, 2020 · Brijesh Saxena
Liked the article? Please don't forget to press on like button. :)
Nov 03, 2020 · Brijesh Saxena
The Source Code can be found here: Chain-of-Responsibility-Design-Pattern-Sample-Code
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Liked the article? Please don't forget to press on like button. :)
Oct 30, 2020 · Brijesh Saxena
Source Code can be found here: Template-Method-Design-Pattern-Source-Code
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
Liked the article? Please don't forget to press on like button :)
Oct 30, 2020 · Brijesh Saxena
Need more articles, please visit my profile: Brijesh Saxena
Oct 30, 2020 · Brijesh Saxena
The Source Code can be found here: Interpreter-Design-Pattern-Sample-Code
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.
Oct 24, 2020 · Brijesh Saxena
thanks :)
Oct 24, 2020 · Brijesh Saxena
thanks :)
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.
Oct 22, 2020 · Brijesh Saxena
Liked the article? Please don't forget to press on like button. :)
Oct 22, 2020 · Brijesh Saxena
Liked the article? Please don't forget to press on like button. :)
Oct 22, 2020 · Brijesh Saxena
Source code can be found here: Flyweight Design Pattern Sample Code
Oct 22, 2020 · Brijesh Saxena
Source Code can be found here: Filter-Design-Pattern-Source-Code
Oct 20, 2020 · Brijesh Saxena
Liked the article? Please don't forget to press on like button. :)
Oct 20, 2020 · Brijesh Saxena
The Source Code can be found here: Proxy-Design-Pattern-Sample-Code
Oct 19, 2020 · Brijesh Saxena
Liked the article? Please don't forget to press on like button. :)
Oct 19, 2020 · Brijesh Saxena
Source Code can be found here: State-Design-Pattern-Sample-Code
Oct 16, 2020 · Brijesh Saxena
Liked the article? Please don't forget to press on like button. :) Happy coding!
Oct 16, 2020 · Brijesh Saxena
Source Code can be found here: Memento-Design-Pattern-Sample-Code
Oct 13, 2020 · Brijesh Saxena
Liked the article? Please don't forget to press on like button. :)
Oct 13, 2020 · Brijesh Saxena
Source Code can be found here: Visitor-Design-Pattern-Sample-Code
Oct 13, 2020 · Brijesh Saxena
Liked this article? Don't forget to press on like button. :)
Oct 13, 2020 · Brijesh Saxena
Source Code can be found here: Iterator Design Pattern Source Code
Oct 13, 2020 · Brijesh Saxena
Liked the article? Please don't forget to press on like button. :)
Oct 13, 2020 · Brijesh Saxena
Source Code can be found here: Observer Design Pattern Sample Code
Oct 06, 2020 · Brijesh Saxena
Liked the article? Please don't forget to press that like button. :)
Oct 06, 2020 · Brijesh Saxena
Source Code can be found here: Facade-Design-Pattern-Sample-Code
Oct 06, 2020 · Brijesh Saxena
Liked the article? Please don't forget to press that like button. :)
Oct 06, 2020 · Brijesh Saxena
Source Code can be found here: Abstract-Factory-Design-Pattern-Sample-Code
Oct 06, 2020 · Brijesh Saxena
Liked the article? Please don't forget to press that like button. :)
Oct 06, 2020 · Brijesh Saxena
Source Code can be found here: Real-Builder-Design-Pattern-Source-Code
and Builder-Design-Pattern-Sample-Code
Oct 01, 2020 · Brijesh Saxena
Liked the article? Please don't forget to click like button as well :)
Oct 01, 2020 · Brijesh Saxena
Source Code can be found here: https://dzone.com/articles/command-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.
Sep 13, 2020 · Brijesh Saxena
https://github.com/BrijeshSaxena/design-pattern-singleton
Sep 12, 2020 · Brijesh Saxena
https://github.com/BrijeshSaxena/design-pattern-nullobject
Sep 12, 2020 · Brijesh Saxena
https://github.com/BrijeshSaxena/design-java-enums-sorting
Sep 12, 2020 · Brijesh Saxena
https://github.com/BrijeshSaxena/design-java-enums
Aug 31, 2020 · Brijesh Saxena
https://github.com/BrijeshSaxena/design-pattern-strategy And https://github.com/BrijeshSaxena/design-pattern-factory
Aug 31, 2020 · Brijesh Saxena
https://github.com/BrijeshSaxena/design-pattern-decorator
Aug 31, 2020 · Brijesh Saxena
https://github.com/BrijeshSaxena/design-pattern-bridge
Aug 31, 2020 · Brijesh Saxena
https://github.com/BrijeshSaxena/design-pattern-adapter
Aug 31, 2020 · Brijesh Saxena
https://github.com/BrijeshSaxena/design-pattern-composite/tree/master/composite
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.
Jan 28, 2019 · Brijesh Saxena
Thanks for pointing this. Corrected. :)
Aug 30, 2018 · Brijesh Saxena
Liked the article? Please don't forget to click like button as well :)
Aug 28, 2018 · Brijesh Saxena
Liked the article? Please don't forget to click like button as well :)
Aug 27, 2018 · Brijesh Saxena
Liked the article? Please don't forget to click like button :)
Aug 24, 2018 · Brijesh Saxena
Liked the article? Please don't forget to click like button :)
Aug 24, 2018 · Brijesh Saxena
I thought its well understood.
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 :)
Aug 23, 2018 · Brijesh Saxena
Liked the article? Please don't forget to click like button :)
Aug 22, 2018 · Brijesh Saxena
Liked the article? Please don't forget to click like button :)
Aug 15, 2018 · Brijesh Saxena
Liked the article? Please don't forget to click like button as well :)
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.
Aug 03, 2018 · Brijesh Saxena
Liked the article? Please don't forget to click like button :)
Aug 03, 2018 · Brijesh Saxena
Like to know more on Singletons? Visit my another article Singleton making more effective
Aug 03, 2018 · Brijesh Saxena
Liked the article? Don't forget to click on like button :)
Aug 03, 2018 · Brijesh Saxena
Liked the article? Don't forget to click on like button :)
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.
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?
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.
Jul 23, 2018 · Brijesh Saxena
We should use lazy loding method with double lock. Will add an example soon.