Pattern is a defined, used and tested solution for a know problem. Design patterns is all about re-use. Software design patterns evolved as a subject of study only when object oriented programming started becoming popular. OOPS and design patterns became inseparable.
In OOPS, we should have well defined boundaries for objects. That is every object should have its roles and responsibilities well defined. Then at next level, we should have a clear interaction plan between objects. If you design a OO software with the above principle, then by default you will be following some of the already defined design patterns.
A formal definition for design patterns, “A design pattern addresses a recurring design problem that arises in specific design situations and presents a solution to it” (Buschmann, et. al. 1996)
Java widely uses design patterns in its APIs. It started as early as Java 1.2 in java foundation classes. By then you can see the widespread use of commonly know design patterns in collections framework and IO packages. When I say commonly known design patterns, I mention about the set of 23 design patterns by Gang of Four (GOF). Gamma, Helm, Johnson and Vlissides known as Gang of Four (GOF) published a book “Design Patterns — Elements of Reusable Software” (1995) based on their series of technical meetings. It is one of the best seller in computer science books till date.
In China gang of four means different set of people. Jiang Qing (Mao Zedong’s fourth wife), Zhang Chunqiao, Yao Wenyuan, and Wang Hongwen were very popular leaders of cultural revolution. They almost seized power after Mao Zedong’s death. But they were finally arrested and imprisoned for life.
Our GOF divided the 23 design patterns into three types creational design patterns, structural design patterns and behavioral design patterns.
Creational design patterns can be used to instantiate objects. Instead of instantiating objects directly, depending on scenario either X or Y object can be instantiated. This will give flexibility for instantiation in high complex business logic situations.
Structural design patterns can be used to organize your program into groups. This segregation will provide you clarity and will enable you for easier maintainability.
Behavioral design patterns can be used to define the communication and control flow between objects.
Following this post, I have planned to write a series of article on these design patterns with java source code examples and UML diagrams. Looking forward to your comments.












Its really a good blog for the people who are looking for java tutorials.
I suggest all to go thru this.
And owner, plz give some more elaborated description for all the topics so,no need to go to another site for reading this.
good work…. keep it up
Hey,
Buddy you have done good job for those who wants to do study on especially Design Patterns,faboulas.Go head….
Thanks Srikanth. I am working on elaborate and detailed tutorials nowadays. Also, I have plans to update already posted tutorials with more details and sample java source code.
Even i like all your elobrated description and all topics is giving depth knowledge .. Please explore also on j2ee tech like springs ..hibernate and also server side like weblogic , websphere
Regards
Nilesh
Hi Joe,
Nice explanation. Can you please post a topic that covers entire Design Pattern in one stroke. This need not be an elaborate one, but would be useful for those who are new to Design Pattern. Just to understand each in a simpler way. If base is strong, probably we can explore more in days to come.
Thanks and Regards
Srikanth S
Hi Srikanth,
I am working on posting about all design patterns. But doing everything in one go will be quite difficult. You can surely expect me to cover as much as design patterns quite soon.
Thanks,
Joe.
Hey Srikanth,
When can we expect more on Design pattern ?
Really waiting for the same.
Thanks in advance
Nice I appreciate you ..keep posting sir..
This blog is useful .And can we expect on more Design patterns?
Thanks
nag
Hi Joe,
Nice blog.. i really love this.. kindly post more .j2ee tech..like taking a simple project and covering all most, all important topics by pratical means(Don forget to post screen shots of those…).Do the same using a frame work(Struts or Spring).
Thanks in advance..
This is really a nice article. You explained the concept in very easy and understandable language. It would be really great if you can give examples of Java API (internally) using design patterns.
Thanks,
Shital
Pingback: Singleton Pattern
Pingback: Decorator Pattern
Pingback: Singleton Pattern in java « kevzpace
It really gud article for beginners easy to understand.
Joe, Good information on design patterns.
hi,
i have a question related to java :
is there a way to create a sdk (exported to a jar file) while having multiple packages and classes in it, so that only a part of its public classes and methods will be available to the programmer who use them?
maybe a design pattern for it?
i’ve read about it over the internet, and it seems that this question is very rare . how could people create sdk’s like that ? did they use a special tool, or did they all flatten all of the packages into one package?
Really impressive.
Can you please explain Business Deligate Design pattern?
plz eloborate the J2EE technologies like
structs and hibernates.
Difference between structs-1 and atructs-2.
I love this article and looking forward for such a great articles from you…
Your work is greatly appreciated…
THANK YOU SO MUCH FOR ALL YOU DO…
Hi Srikanth, why can’t post about the J2ME as you are sharing the knowledge about Java ..
Sorry for giving wrong name JOE..
Pingback: Facade Design Pattern
Pingback: Adapter Design Pattern
Pingback: Prototype Design Pattern
Hi Joe,
Nice explanation. Can you please post a topic that covers entire Design Pattern in one stroke. Just to understand each in a simpler way. If base is strong, probably we can explore more in days to come.Can you please explain me in detail
Thanks,
Lakshman
Pingback: Proxy Design Pattern
I am looking forward for more articles.
The way you write and explain things in short is amazing. I checked your blog just yesterday finding ajax tutorial and now m going through other articles as well. Great work.Keep writing.
Pingback: Flyweight Design Pattern
Hi Joe,
Thank you so much.We are eagerly waiting for you article on Design Patterns(which include Java code and UML diagrams).
Thanks in Advance.
@jayaram,
Many articles are already posted :-)
Pingback: JAXB Tutorial
Joe,
I too love Java by heart & reading your multiple blogs on Core Java keep me tightly coupled with Java, I appreciate your efforts in popularizing & helping many Java Techies.
Its really feel good that you’r looking forward to cover up SPRING in your future releases.
I wish you BEST OF LUCK for all your upcoming blogs. Once again you’r helping so many people by sharing your knowledge, Hv a happy ahead.
Thanks Rashmit
i like java
Pingback: Chain of Responsibility Design Pattern
Hi joe, really nice article, thanks for explaining it in very simple terms. Really easy to understand it. I have one request could you please explain hashcode() from Object and String class?
Thanks this blog is very helpful
hello sir, i want to know that how we use design pattern in real project envoironment .
Hi joe
This is Suresh.And i red the some of the article of your’s,Those are very nice and shows some interest for the learners
if you never mind now i would like to give a small suggession to you that if you add some practical implemtation exmaples for the desingn patterns that will brings effective explaination for the readers
Thanks and Regards
Suresh
Pingback: Dependency Injection (DI) with Spring