문제

Possible Duplicate:
Is there a canonical book on design patterns?

I'd like to read a design patterns book. GoF for sure is the one to read. But after 15 years is it still valid, I mean isn't there an updated one?

Something like "Charles Darwin On the origin of species" is a very important book, and some main concepts are still valid, anyway today (2010) one would read another book to study the subject.

In this question the main suggestions are the Head First and GoF books. But Head first is not a replacement for GoF.

So any suggestion or should I stick with GoF?

도움이 되었습니까?

해결책

I recommend reading the Head First book first, as it does a better job of explaining why design patterns are needed. After that, you can use the GoF book for examples and as a reference.

다른 팁

I fear the day the patterns in that book will not exist anymore. That day is likely never to come. Get the book.

Stick with the GoF. In addition, I'd suggest you read the following:


Steven John Metsker's "Design Patterns Java(TM) Workbook" (ISBN 0201743973)

I think this book is a nice complement to the GoF or it could be safely used instead of the GoF if you are learning or working with Java. Similar books exist for other languages like C# and Ruby, but I cannot attest of their quality since I have not read them.


William C. Wake's "Refactoring Workbook" (ISBN 0321109295)

Refactoring goes hand in hand with patterns. This one is a nice workbook to read.


Brown et al "AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis" (ISBN 0471197130)

The other side of the coin are anti-patterns, code smells that scream for refactoring. This book is good (at least the first half that deals with software-related anti-patterns.)


Craig Larmans' "Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development (3rd Edition)" (ISBN 0131489062)

Larman's book is pretty much becoming a de-facto preferred textbook for undergrad courses in software engineering and systems analysis. It does a good work in walking through the utilization of UML and patterns in an iterative process.


Chris Okasaki's "Purely Functional Data Structures" (ISBN 0521663504)

I would consider this book once you have developed a good working knowledge of patterns, anti-patterns and re-factoring. It is a theoretical treatise of patterns and data structures from a purely functional point of view.

One of the things with the GoF (and books that carry that baton) is that those patterns are the product of an era where generic programming was finally being realized in C++. The patterns presented therein existed to accommodate a OO and procedural/algorithmic paradigm.

Several of these patterns (visitor for example) don't have much of a reason to exist in languages that treat functions as first-class objects. I would not touch this book without a good grasp of patterns and functional languages, though

You will still need it. You will keep coming back to it for double checking and small revisons and good examples. Keep it on your shelf. If you are a starter pick up Head First. On the contrary I am very interested in finding out a book which is rated higher than GOF :-)

Definitely one to keep a copy of around. I've had the GoF book since I first started in software and find it's once one of those books that I get more out of every time I re-read it (and no, I don't read the whole thing cover-to-cover - just the odd pattern here and there). It is, however, one of those books that I felt as a "beginner", I never got as much out of it as i did later in my career. I found that having more experience makes the book a much more interesting and, of course, more relevant.

go for the Head First. it explains how you write code the usual way, what the problem would be with a modification not done the right way, the design principle to apply, the refactor and then points the result to what pattern you just used.

i found the design principles most useful. would not have bothered with the patterns if the principles weren't explained

It depends heavily on your scope. If you are more of an enterprise Java/C# or hardcode C++ type then yes, go get a GoF and probably some other books on the topic too (see other answers). However, if you can imagine working in a dynamic language with higher order functions and more advanced concepts, you mostly won't need any of those patterns. Even worse: you'll get less productive since you'll be looking for patterns to implement instead of thinking in language terms and (ab)using its power. Looking at Python, Ruby, (modern) Perl, Erlang, Scala, Clojure, Lisp, you name it, in every one of those languages no patterns from GoF are needed, since frankly, the patterns are a good way to solve some problems inherent to languages without higher-order constructs.

That being said, learn the patterns anyway either way, but be critical of them and learn to use them properly and sparingly. They are not the silver bullet and never going to be.

Definitely begin with GoF - but bear in mind that since it came out there are numerous books with various pattern catalogues in them (most of the 'signature' series comes to mind, such as PoEAA or Enterprise Integration Patterns) which take the pattern idea into more specific areas.

Also remember that the implementation of some of the patterns is potentially a little archaic depending on the language you're working in. For example, although you could implement the Java code pretty much as-is in C# (and that would have been fine when C# 1 was knocking about) you'd be missing out on the potential that some modern language features provide. Specifically for .net I like the examples from dotfactory, Judith Bishop's book is pretty good too.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 softwareengineering.stackexchange
scroll top