Patterns For Beginners

I am writing the following in spite of the fact that most regular Wiki visitors could have done it better, just to get this page started. Please improve (by editing instead of commenting, if possible, to keep things simple). -- FalkBruegmann

Patterns are a way to analyze solutions to recurring problems, make them reusable and communicate them. Patterns are a way of thinking. Patterns are also a cult.

To generalize a solution to a problem, you have to look at the problem in its context: What are the (conflicting) goals, the forces, that recur in that context?

Describe the problem and its context, add an elegant solution that resolves the forces (that is, brings them into a dynamic balance), give the whole thing a name, and there you are - you have a pattern!

Because they turn out to be unbelievably useful, patterns have sprung up in a variety of fields: First in Architecture (buildings, not software!), then in Software Development, and now everywhere. :-) Although in mathematics the notion of generic grammars has been known for centuries to describe solutions to problems, the general public has no understanding of the math language. Patterns as defined by the originator ChristopherAlexander are much more readable and are a textual description of the core of a solution to a generic problem.

A variety of pattern categories are recognized in software pattern community. DesignPatterns are the most well known, but there are also ArchitecturePatterns?, AnalysisPatterns, OrganizationalPatterns and ProgrammingPatterns (also called Idioms). Finally, there are AntiPatterns, patterns where the solution looks attractive, but actually creates more problems than it solves.

The most successful pattern book, and possibly the first one to buy (after browsing Wiki, of course), is DesignPatterns by the GangOfFour (ISBN 0201633612 ). It is also worth reading the original architecture book, TheTimelessWayOfBuilding by ChristopherAlexander. This book is very good for understanding the need for patterns and differentiating between good and bad patterns that occur in a system. Even though the book is about architecture of real buildings, its comments and text seem to relate so much to software engineering, with statements like "the minute an idea for a project is conceived, it's already too late to think of it from scratch!".
This discussion might be useful for pattern newbies : http://www.nooranch.com/synaesmedia/wiki/wiki.cgi?PatternLanguage
I generated this page in response to a beginner's angst at finding it difficult to learn object-oriented design (in particular, program design) from the materials in this WikiWikiWeb. Not, frankly, because I have much to say on the subject, but to reassure the original author that design patterns aren't a natural way to think even for one who has been programming for thirty years.

The required introductory material should be a little less academic in tone than the GoF book, I think. I've seen books on design patterns which appeared to have obfuscation as their primary goal. This is, in part, why I am coming so late to the party.

-- SteveHolden
For a beginner, my personal book recommendation is ObjectOrientedDesignHeuristics (ISBN 0-201-63385 ), which is somewhere between teaching how to recognize basic CodeSmells and basic design patterns. If you're interested, have a look at the reviews on amazon.com. --FalkBruegmann
see http://www.patterndepot.com/put/8/JavaPatterns.htm
People who are beginners at programming should not study design patterns. The DesignPatternsBook says it is for people who have been using C++ for a couple of years and who have just figured out that object-oriented programming is harder than they thought. If you are new to patterns, but not new to object-oriented programming, the DesignPatternsBook should be readable enough. If it is not, join a DesignPatternsStudyGroup or join a mailing list where you can talk about it with others. If you are new to objects, I would recommend ObjectOrientedDesignHeuristics and SmalltalkObjectsAndDesign. --RalphJohnson
If you are trying to tackle the original GoF DesignPatternsBook and having difficulty, I recommend taking a look at HeadFirstDesignPatterns (ISBN 0596007124 ). Its written in the HeadFirst? style - meaning lots of humor, pictures, practice questions and problems to get you to really wrap your head around the patterns discussed. Its certainly not a replacement for the original book, but a useful companion. --RobSanheim