Examining Patterns Critically

Using a published pattern is like getting advice. If the advice is from a total stranger, you'll want to check to see that the advice is good. If the advice is from your best friend or someone whose expertise you trust, you're more likely to follow the advice, but you'll still consider whether the advice is appropriate for your situation.

Similarly, not every pattern will be right for you. You need to determine whether a pattern will help you solve your problem. And, in order to do this, you need to read the pattern with a critical eye. In this section, I show you how to do exactly that.

Asking the right questions about patterns

The first step in evaluating a pattern is to ask yourself a few key questions about the pattern. Armed with the answers to the following questions, you can begin to get a sense of whether the pattern is right for you:

  • Is the pattern useful? In other words, does the pattern solve a real problem and, in particular, does it solve the problem that you currently have? The pattern may be useful for another problem, but if it doesn't solve your problem, it won't be much help.
  • Does the pattern contain enough information to implement the solution? Sometimes you're looking for a pattern that will help you with the overall structure of the system, but you won't be implementing anything yet. Other times, you'll want detailed implementation instructions because you need to write some code now. The pattern should provide the kind of implementation ...

Get Pattern-Oriented Software Architecture For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.