IBM®
Skip to main content
    Country/region [select]      Terms of use
 
 
    
     Home      Products      Services & solutions      Support & downloads      My account     
 
developerworks > My developerWorks >  Dashboard > Bobby Woolf: WebSphere SOA and J2EE in Practice > ... > Miscellaneous Non-Technical > Pattern Template
developerWorks
Log In   View a printable version of the current page.
Overview Connect Spaces Forums Wikis
Pattern Template
Added by bwoolf, last edited by bwoolf on Nov 09, 2006  (view change)
Labels: 
(None)

Pattern Template


What template should I use for documenting a pattern?

My Basic Template

This is the template I presented in my talk "How to Write a Pattern" at WebSphere Technical Exchange 2006. It's not "mine" in that I've worked with lots of people who have helped develop it over the years, starting with Christopher Alexander himself (whom I've never worked with directly). But for anyone who disagrees with this template, fine, this is in my opinion a good template and the one I tend to use.

The template:

  • Name
    • Intention revealing noun phrase
  • Context
    • Reader's activity that leads to problem
  • Problem
    • Difficulty reader needs to solve
  • Forces
    • What makes the problem difficult to solve?
    • Discusses possible solutions that ultimately don't work
  • Solution
    • How to solve the problem and balance the forces
    • Not a bad solution - that's an antipattern
    • A good solution - that's a pattern
  • Results
    • Details about the Solution
    • Reader's situation now that problem has been solved
  • Examples
    • Show the pattern in action
    • Show known uses of the pattern

Other Templates

There are lots of opinions about pattern templates, and therefore lots of templates. Here are some options:

  • The template in Enterprise Integration Patterns is shown in the Introduction in the "Pattern Form" section. Notice that it's very similar to the one I presented because I wrote the presentation and am a co-author of the book. The book's template has more sections; for simplicity, I only list the required sections in my presentation. Note too that in the book, we don't label the sections in a pattern (except for the Examples).
  • Core J2EE Patterns template – This is fairly similar to the template I use.
  • Design Patterns (GoF) template – I've used this quite successfully for patterns on how to design good OO code. But this template is very different from the problem-solution pair I prefer, and not a good general purpose template (MHO).
  • Ward's Wiki has a couple of options:

Examples

Examples are a little hard to come by because most of them have copyrights. One place that has a lot of good examples of patterns using the template I like plus a good example of an overall pattern language is--if I may say so myself--Enterprise Integration Patterns. Seriously, it's a good example of what the whole pattern and pattern language thing is all about.


 
    About IBM Privacy Contact