Pattern Conflicts

Two or more patterns conflict when they provide mutually exclusive solutions to similar problems.

KentBeck's SmalltalkBestPracticePatterns includes an excellent example of two conflicting patterns --- DirectVariableAccess? and IndirectVariableAccess?.

In GOF Decorator and Strategy conflict, as does Prototype and Factory Method.

JamesNoble


RelationshipsBetweenPatterns


Decorator and Strategy are competing patterns, but Prototype and AbstractFactory are not. AF is about building a factory that produces multiple products, while Prototype is about building a product by copying an example. You can easily have a AF that produces products by copying prototypes.

--- Good Point. What's really going on is that Prototype, Creating objects by calling a class creation method or constructor, and creating objects by calling a FactoryMethod conflict. Any given problem will be solved by using only one of these patterns (the client syntax is different for each one). AbstractFactory can use any of these patterns to provide its family of objects. More complex creation patterns link Builder, ProductTrader? (and there must be an interpreter variant too) then use these patterns; and so it goes.

EditText of this page (last edited October 15, 2010) or FindPage with title or text search