views:

1762

answers:

9

I know the MVC design pattern but would be a little unclear about other Java design patterns, so I was just wondering if there's any useful books or other resources you could recommend to get up to speed with these patterns?

+15  A: 

Head First Design Patterns

Paperback: 676 pages
Publisher: O'Reilly Media, Inc.; 1 edition (October 25, 2004)
Language: English
ISBN-10: 0596007124
ISBN-13: 978-0596007126

The examples are in Java, but I find it to be the best beginner text on the subject regardless of the language.

Daniel Auger
I am reading it right now, and the way the book is written really seems to be effective in getting the patterns to 'click' for me.
Alex Baranosky
It's the best book on design patterns I have encountered so far. Great examples and really simple to understand.
flash
A: 

Well design patterns are language agnostic. You can use them in any language. I primarily program in .NET, C, C++, and Ruby, but I use these books. They are very good.

Dale Ragan
+1  A: 

Design Patterns: Elements of Reusable Object-Oriented Software by the Gang of four is a very good start if you want to learn about design patterns.

pr0nin
+3  A: 

The definitive guide and a must-have tome is Design Patterns by Gamma, et al (a.k.a. the Gang of Four, or simply, GoF). For Java-specific I'd recommend Sun's Applied Java Patterns by Stelting and Maassen.

Thanks for the correction, Luke!

Danny Whitt
+1  A: 
Bjorn Reppen
+2  A: 

Design Patterns Explained: A New Perspective on Object-Oriented Design, by Alan Shalloway and James R. Trott is a very good introduction. Code examples are written in Java.

Brian
+2  A: 

I did things in reverse order. Firstly, I read most of the GOF book. While it is undoubtedly the definitive text in the area, I found it to be a little hard to read in places, and certainly not the most exciting text you will ever read!!

I have recently started reading Head First Design Patterns and it is excellent. Certainly much easier to read, and it is very engaging. Much better for learning.

So, get Head First Design Patterns, read that. It should give you a good understanding of the various patterns etc. Then, if you want to, get the GOF book for a reference (there is a strong overlap of patterns).

Oh, and as an aside, Heads First is all Java based, while the GOF book is (I think) more in C++ and Smalltalk (but the patterns are language agnostic, so that doesn't really matter).

Lehane
+1  A: 

Another book I enjoyed was Refactoring to Patterns

This contains good examples of where a design pattern can make your code easier to understand, and describes the mechanics for gradual 'behaviour-preserving' modifications to move your code towards a design pattern.

I wouldn't read this until after Head-First / GoF, and also after Refactoring

toolkit
+1  A: 

Honestly, I think Martin Fowler's Patterns of Enterprise Application Architecture book is the best modern patterns book I have seen. It covers a lot of material, and yet still functions like a catalog when you need it to.

There is a fairly new book by Scott Baine called Emergent Design which covers design patterns, test-driven development and refactoring in a really fun and interesting way. I am still half-way through, but I find it very accessible. I have the GoF book too, but use it primarily for quick reference.

Sam McAfee