Friday, June 29, 2007

Design Patterns Trivia!

How confident are you in your design patterns?

Here's a site to test out your design patterns recognition - GoF design patterns quiz. This quiz is good to familiarize yourself with recognizing design patterns when you see them. Its not very good for judging when to use the pattern in your code or what problems it solves, but it does give you hints. You need to do match a given pattern with its name.

Here's an example - can you recognize what pattern this is?
















Here are some hints:
  • Recursive composition
  • 1-to-1 'has a' up the 'is a' hierarchy
  • Intent: Add additional responsibilities to an object dynamically
Any guesses?

Answer is Decorator Pattern.

No comments: