• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what is the best way to learn design patterns?

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
tips and advise very welcome.
 
author
Posts: 799
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's an approach:
Work with someone that has used a design pattern in your system. Have that person explain the implementation of the pattern to you and why they found it useful. Go read about the pattern.
Unfortunately, there's no Java-centric book on design patterns I can heartily recommend. The best source is the Design Patterns book itself (Gamma, et al 1995). You might also find some useful sources on the web; hillside.net used to be a good resource.
Read the material on the pattern, particularly the motivation and consequences, but really just read everything. Read it again until you understand it. Understand why it was useful as a solution in your system. Understand what are all the implications of the various alternative implementations.
One other thing I've found useful is to build a pattern "reference implementation" that allows you to trace through the code to see what's really going on. I found this particularly useful for the somewhat confusing visitor pattern and all of its many variations.
You can't and you don't want to try and learn all the classic design patterns overnight. You also want to avoid using a pattern as a wedge--"I just learned about the composite pattern, so now I'll try to force a composite pattern into the problem I'm trying to solve."
-Jeff-
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Join/set up a study group: http://www.industriallogic.com/papers/learning.html
 
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"J2EE design patterns" from Sun also is good if you are going to work on the J2EE environments.
"Design Patterns" by Gamma etc is also good and extensively used by the industry.
Dan.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chris Daniel:
"Design Patterns" by Gamma etc is also good and extensively used by the industry.

...but perhaps not the best choice for starters because of its not-so-good readability and because the language details (C++) might distract a Java-only developer.
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
When I started in my first job I had no clues about design patterns and the application I was going to work in was developed using patterns in a very strict way. I started as a trainee, so what my project leader did was, he made me understand first the MVC architecture, because most of patterns are divided this way, also understand multi-tier applications. The I started reading the book "Core J2EE Patterns"and I was reviewing the code and the application. I also reviewed the sequence diagrams for the application, I found those very useful because you could visualize the layers of the applications.
As someone else said, you need someone who knows patterns to coach you. Once I got understanding of patterns, it changed completely how to think in applications.
Good Luck!!
 
author
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd just like to echo Jeff Langr sentiments at the end of his post. There is a danger, after learning design patterns, that you will begin to see all kinds of places where you could apply a pattern, even where there's no real call for it. Don't fall into this trap that so many pattern newbies do. Be wary about over-engineering.
Patterns can be an elegant solution to certain problems, but don't build in flexibility that you don't need.
David
 
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bruce Eckel's Thinking in Patterns - any opinions ?
Bruce Eckel's Free Electronic Books
[ February 18, 2004: Message edited by: HS Thomas ]
 
Jeff Langr
author
Posts: 799
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It only looked like there was a ZIP file with code at the Eckel page--did I miss something?
-Jeff-
 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thinking in Patterns
I liked Thinking in Java from an OO perspective ; but perhaps probably trying too hard to fit the same idea with Patterns ?
 
You know it is dark times when the trees riot. I think this tiny ad is their leader:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic