Sunday, August 12, 2007

AntiPatterns Reference Model

Patterns and AntiPatterns are related concepts, as shown in the figure. The essence of a design pattern is a problem and a solution. The problem is usually elaborated in terms of its context and applicable design forces. The role of the solution is to resolve the design forces in a way that generates some benefits, consequences, and follow-on problems. These new problems lead to the applicability of other patterns. Patterns are commonly occurring solutions that are frequently observed in practice. To be considered a pattern, the solution needs to be observed at least three times. Because no three occurrences can be identical, the design pattern is an abstraction of these experiences.

The essence of an AntiPattern is two solutions, instead of a problem and a solution for ordinary design patterns. The first solution is problematic. It is a commonly occurring solution that generates overwhelmingly negative consequences. The second solution is called the refactored solution. The refactored solution is a commonly occurring method in which the AntiPattern can be resolved and reengineered into a more beneficial form
Both design patterns and AntiPatterns are written by starting with the solution. The context, problem, and forces in a design pattern are written to lead uniquely to one solution. In order to ensure a unique mapping to one solution, design patterns often contain lengthy explanations of design forces. AntiPatterns are based on a different rhetorical structure. AntiPatterns begin with a compelling, problematic solution, then offer an alternative solution that refactors the problem. The refactored solution is not guaranteed to be unique; it is an effective way to resolve the forces that ensure more benefits. Any significant variations of the solution are included in a separate template section.
In practice, we have found AntiPatterns to be a much more powerful and effective form for describing recurring solutions than design patterns.

No comments: