Head First Design Patterns and the Design Pattern Wikipedia page are the best resources for beginners. FluffyCat is another good, free online resource for design patterns in both Java and PHP. The Gang of Four book is where to go afterward, but it's fairly advanced, so I'd wait until you have a pretty firm grasp from the other resources.
2 I second your second! – BQ. Oct 28 '08 at 20:30 3 There are C# code examples for Head First Design Patterns available at msquaredweb.com/DesignPatterns/… – toolkit Oct 28 '08 at 20:35 3 I looked at that book...hated it.So I picked up the GoF book and learned all about design patterns from that.
It was kind of dry, but much more informative. – Thomas Owens Oct 29 '08 at 12:53 1 I initially thought that the head first book was going to be completely nauseating (it's heavy on metaphor, asides, and has a very conversational tone).. but it's actually really inventive and informative; I'm very happy I took the risk and bought it. Imo, choosing gang-of-four = needless masochism.
– codeinthehole Nov 2 '08 at 20:35 2 I did find the head first book completely nauseating. It spends so much time being "fun" I think it communicates the key ideas poorly - they get lost. Reading it is like watching someon'es dad try to be cool.
But the GoF book is the other extreme and thus not for everyone. – Draemon Nov 27 '08 at 4:25.
Design patterns are great for various reasons: gives you a starting for solving common problems. Gives developers a vocabulary to talk about certain ways of solving problems in a very compact manner. When working with developers who know design patterns and you use design patterns in your solutions they will understand the solutions a lot faster.
But when your goal is just to learn design patterns I think you are missing the fundamentals. All design patterns are based on more common principles. Low Coupling Open Closed Principle, DRY, Liskov Substitution Principle etc.For these fundamentals I would read the following books in this order: Head First Object-Oriented Analysis and Design (Head First) ILLUSTRATED (Paperback) Applying UML and Patterns (Hardcover) Agile Principles, Patterns, and Practices in C# (Robert C.
Martin Series) (Hardcover) After that you are ready for the basic gang of four design patterns Head First Design Patterns (Head First) ILLUSTRATED (Paperback) The BIBLE A nice website (don't buy anything, it is not worth it) http://dofactory.com/Patterns/Patterns.aspx (some implementations of this site are worth a discussion The next step: Patterns of Enterprise Application Architecture (Addison-Wesley Signature Series) (Hardcover) The POSA books And always remember : the pattern is not the goal!
2 I think the fundamentals of OO (encapsulation, inheritance, polymorphism, etc. ) are enough to knowledge to start learning design patterns. You can learn the other principles ( Low Coupling Open Closed Principle, DRY, Liskov Substitution Principle, etc.) through learning patterns. – Bill the Lizard?
Oct 28 '08 at 22:22 I agree you can learn design patterns with only the fundamentals of OO. But then you make it to the point that you can make a pattern work but not yet fully understand why this is good design, what trade-offs you have made and how you can make variations in the patterns. – KeesDijk Oct 29 '08 at 7:07.
I'd add that Design Patterns book from the "Gang of four" is a bible for anyone who is seriously interested in design patterns.
9 Or for anyone who wants to tell their programmer friends that they've read the Gang of Four book :) – Dave Markle Sep 1 '09 at 9:10.
My tip: Read a lot about the patterns from different sources. Trying to force as many patterns as possible into all the code you're writing as this point is not going to give good results. Instead, let the information rest inside your brain for a while (read: months).
Suddenly you'll find yourself stumbling upon a problem or piece of code and you'll vaguely remember that you've seen something that might work as a solution to this particular problem. Now is the time to look up the details on the pattern you are thinking of and try to apply it. That's what has worked for me, anyway.
Bruce Eckel has a book on design patterns, although it's Java, it's like all of his books amazing. And the best thing is, they are free!
Thanks for the link, didn't realize that was up for free on-line. – James McMahon Jan 21 '09 at 20:15.
C# 3.0 Design Patterns for a C# perspective on design patterns.
Design Patterns This tutorial site contains following sub-sections Intent of each design pattern Real World Structure for the design pattern A Problem statement Detailed discussion on the problem Checklist on how to arrive at a pattern Rules of thumb while arriving at pattern. Code snippets for the design pattern which includes C#, C++, Delphi, Java and PHP This site also contains guide on Anti Patterns, UML and Refactoring.
An introductory book that I found useful and well written is Design Patterns Explained by Alan Shalloway and James Trott (Addison Wesley). Do not start from the Gang of Four book, for it is not an introductory book by any means.
I would recommend taking a look at Jean Paul Boodhoo's quintology (?) on Demystifying Design Patterns on DNRtv, urls supplied below. The videocasts touches on Singleton, Abstract Factory among others- the difference being that you can watch him code as he discusses the theory. Good to watch over lunch on a rainy weekday.
dnrtv.com/default.aspx?showNum=63 dnrtv.com/default.aspx?showNum=65 dnrtv.com/default.aspx?showNum=68 dnrtv.com/default.aspx?showNum=71 http://www.dnrtv.com/default.aspx?showNum=92.
An annotation to the above comments. A Quick Reference For GOF Patterns Here is a good place you can start dofactory.com/patterns/patterns.aspx - You can find link to each pattern, along with corresponding implementations. How ever, remember that these are GOF patterns.
You might need to read and understand advanced patterns as well, once you gain enough expertise in OOAD. Head First Design Patterns is a good start, and after making some progress, go with Martin Fowler's Enterprise Application Architecture Patterns. Applying Design Patterns - The Thought Process Another main aspect - Applying Design patterns is as important as just knowing them.
Reading these articles might help you as well. Applying Design Patterns Part I Applying Design Patterns Part II Hope this helps.
Patterns of Enterprise Application Architecture (Hardcover) by Martin Fowler Refactoring to Patterns (Hardcover) by Joshua Kerievsky Continuous Integration: Improving Software Quality and Reducing Risk (Paperback) by Paul Duval et.al. Beyond Software Architecture: Creating and Sustaining Winning Solutions (Paperback) by Luke Hohmann.
Applying UML and Patterns by Craig Larman. Start from the basic of analysis, design and uses a simple Case scenario. Introduces most of the basic patterns in a simple way.
Head First Design Patterns is a good one like others already noted. Besides this, of course the original book and C# Design Patterns. Also there are good websites already mentioned.
Besides self-learning, I seriously recommend starting or attending a pattern study group in your area. See A Learning Guide To Design Patterns for explanation and great order to study the patterns in. We did this and I can honestly say that I would not understand as much as I do now.
A weekly meeting with other interested people keeps you surprisingly disciplined when learning something abstract like design patterns. Happy studies!
Before spending money on books I would recommend Wikipedia's excellent design patterns page. Also for something different Google for "design pattern screencasts" or search for "design patterns" on YouTube. Getting the same information presented differently often helps the penny drop.
The Gang of Four book is the definitive text on the most well known patterns but is not that easy to read and with C++ examples not everyone's favourite. The Head First Design Patterns text is far more accessible but only contains a subset of the Gang of Four patterns. The most important thing is to understand where and why a particular pattern is useful.
Afterwards search the web for implementation examples in the language of your choice and experiment until you "get it". Understand one pattern before moving on to the next. Everyone understands some patterns better than others (and there are hundreds of lesser known ones).
Just keep plugging away.
Design patterns are like any library function, read about them, then when a problem comes up, the design pattern will be in your "Toolchest". There are many design patterns books all patterned after the original "Gang of four" design patters. For any programmers, I think that and the Refactoring book by Fowler are the absolute minimal requirements.
The POSA books were not "patterned after the GOF" book - the GOF happened to be first to be published - they were in production at the same time. – Tim Oct 28 '08 at 20:30 1 Just to avoid any confusion, I want to say that MOST design patterns are NOT implemented in a library. Many patterns are formed by combining library classes together.
– Bill the Lizard? Oct 28 '08 at 20:30 I did make it sound like they could be done in a library--sorry about that, thanks for the clarification, Bill. Design patterns are generally LIKE libraries but things you can't typically PUT in a library--like different ways that classes unknown to each other interact.
– Bill K Oct 29 '08 at 15:58.
For websites, a very good site is ajaxpatterns.org, from one of the developers of the ajaxian website.
The original Design Patterns book is a must-read for all programmers. It is an excellent book on every level: layout, clarity, insight, depth. It's one of those great books that you first read cover-to-cover, and then use as a reference until you literally know it inside out.
You could start by the Wikipedia page, but treat yourself with the great book too.
If you read about design patterns you'll notice that Java seems to have a few of them implemented. Look at the source for any framework and you can glean info about design patterns. Personally I don't see them fitting in perfectly to any of my code, sometimes the examples in books and tutorials seem a little idealized, especially for the lone coder.
Design patterns aren't for lazy coders.
For me and my colleagues study Design Pattern that following on Pattern Study Group. They prepare a list of each pattern that we should learn in order and also have the opening questions that make more discussion in group.
I also suggest having a shufty at Refactoring to Patterns once you've read Head First Design Patterns. Note: The code examples are in Java, but should be very similar to C# examples...
It does not make too much sense to me for someone with very little experience to delve too far deeply into design patterns. It is great to know they exist, but at this point you should focus more on other things rather than just learning about design patterns. They are useful in context of a problem - as a concept for a new/beginner developer they are really not too much practical value aside form knowing that you should make use of them when and where you can.
EDIT To clarify - many design patterns are a result of problems found in some domains. A new programmer can hardly be expected (IMO) to know the design pattern(s) to use for some set of problems. Just as we get a smattering of algorithms in CS studies, we need an understanding of the things we can do with patterns and their benefits, but when a person is still building hello world or discovering stl there is not much practical need for design patterns.
Patterns are great. But they are not the silver bullet. (Neither was CASE (tools), neither is/was UML, neither is SCRUM, neither is TDD, nor STL, nor Java, nor XML, etc.) These are all just aspects of our profession and to treat these topics as the second coming is naive.
But if you don't know about the patterns, you won't know if there's one out there that addresses your particular problem. Yes, as a newbie you are unlikely to NEED a pattern, but it's important to learn the patterns before that need arises. – Elie Oct 28 '08 at 20:31 I think I covered that in my post... – Tim Oct 28 '08 at 20:34 You need to have more than just knowing that they exist.... you need to know how they work and the kind of situations where they are used.
That's a bit more than superficial knowledge. It may be years before you use a pattern, but when you do, it's not the time to learn the pattern. – Elie Oct 28 '08 at 20:36 So you're saying a newbie has to learn and understand dozens or more of patterns?
What comes off the table in the meantime? I am not arguing against patterns. And I also don't think that learning the specifics of a pattern JIT is a bad thing.
Learning patterns before other stuff IMO is not useful – Tim Oct 28 '08 at 21:12.
Patterns comprise the high level vocabulary programmers use to talk about abstract design. If you are reusing an abstract solution, it is helpful to refer to it by name. If you invent a pattern, it is professional to do a little checking to make sure it hasn't already been given a name.
If it has been named, then the description may be useful. After you code even a tiny bit, you will notice yourself writing something similar to what you coded before. This is a pattern.
Even if it is a tiny pattern, it is worth noticing. Is there a better pattern? Do you see certain tiny patterns cooperating together to solve a larger problem?
Well next time, when you want to solve larger problem, the entire pattern comes into your mind as a single chunk. Fleshing out the detailed lines of code becomes mechanical. The more you notice patterns, the easier programming becomes, and the more you will appreciate some of the biggest and best patterns worked out by other programmers.
Try mastering the MVC pattern. One way or another, variations show up all over the place, even in tiny design decisions.
Once you understand the concept, go through the Eclipse source code or design, lots of really good examples of these patterns (no surprise, Gamma was one of the designers).
I have found Design Pattern articles on this website really easy to understand Design Patterns in C.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.