views:

255

answers:

7

Am new to design patterns, could you recommend a open code base (preferably in java) that has design patterns used explicitly and elegantly. Reading up GOF has left me confused am looking for a project that used a few patterns that interacted with each other. thanks.

+6  A: 

You can look at JUnit and some of its docs. Also, JUnit is extremely useful tool by itself. I think any Java developer must know how to use it.

You can also find interesting conversation with Erich Gamma, posted on Artima.com:

  1. How to Use Design Patterns
  2. Erich Gamma on Flexibility and Reuse
  3. Design Principles from Design Patterns
  4. Patterns and Practice
  5. Eclipse's Culture of Shipping

Maybe, not all parts of that conversation are relevant to your question, but they all are very interesting.

Rorick
thanks Rorick, the doc was exactly the kind of example I was looking for
Glad to share) These docs were very useful for me.
Rorick
+2  A: 

Hi,

I think that there is not any code base with design patterns applied. This patterns are applied differently from project to project.

The pattern is a guide, a proven solution to a common programming or design problem that has been around in the development life cycle.

I would like to suggest to read the Head First Design Pattern book, it is very to the point and has a nice examples.

Regards

Arturo Caballero
+1  A: 

The JDK itself has some good examples.

For example, the InputStream / OutputStream, Reader / Writer implementations demonstrate usage of the decorator pattern, in the sense that you can wrap an OutputStream with another implementation in order to layer on additional functionality.

Adamski
+3  A: 

Rather than a code base, i will recomend the reading of Head First design Patern , by oreilly. This books contains some really didactic exemple.

But the JDK is full of Design Pattern too. You can find Observer/observable , Iterator. Or more subtle, Decorator in the Java I/O API

The google book link to Head first design pattern

Antoine Claval
Head first design patterns is very over rated, it's patterns dumbed down to much. I spend to much of my time correcting miss conceptions created by this book.
Martin Spamer
A: 

May I recommend just looking at Wikipedia instead of GoF? I found the book hard to read, but the Wikipedia Article on Design Patterns was awesomely useful for me.

It then drills down into useful examples, such as Singleton, Lazy Initialization, Decorator and so on, all with good code examples, and all free.

Dean J
A: 

I think you need to see how Patterns are applied in practice in the real world, the book Core J2EE Patterns: Best Practices and Design Strategies (2nd Edition) is a bench mark book showing the main patterns used to produce real Web Application in java.

Martin Spamer