Comparing Two Patterns: Adapter and Façade
(Note: if you are unfamiliar with these patterns, you can read about them at our pattern repository)
One reason people often struggle to understand how to get real value from patterns is that sometimes two or more of them can look, at first glance, extremely similar. When I'm teaching patterns, people will very often point out how similar the Strategy and Bridge patterns are, or the Decorator and Chain of Responsibility, or the Factory Method and Abstract Factory, etc…
Usually this is because people often confuse the example of the pattern that's being presented to them with the pattern itself. Patterns are neither UML diagrams nor code examples; they are a higher concept that captures best practices, domain and implementation forces, and the consequences (both benefits and costs) of certain decisions. Diagrams and code are simply representations of the patterns, and are always more specific and narrow than the patterns themselves are.
This misunderstanding is an opportunity, however, because when we compare two patterns that appear similar and determine how they are actually different, we can sometimes dramatically enrich our understanding of them.