CSC/ECE 517 Fall 2009/wiki3 1 co: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 8: Line 8:
== What are Anti-Patterns? ==
== What are Anti-Patterns? ==


text
Different texts define the term '''anti-patterns''' in different ways:
* ''"An AntiPatern is a literary form that describes a commonly occurring solution to a problem that generates decidedly negative consequences."'' - '''[http://www.amazon.com/exec/obidos/ASIN/0471197130/theantipatterngr AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis]'''
* ''"Anti-patterns are patterns that initially seem effective, but over time you learn that they lead you into traps."'' - [http://systeminetwork.com/article/anti-patterns-avoid-programming-dark-side Anti-Patterns: Avoid the Programming Dark Side]
* Over the last decade we have witnessed the maturity of both best practices...and worst practices (as manifested in the anti-patterns movement...). - [http://www.jot.fm/issues/issue_2006_07/column4.pdf Patterns of Anti-Patterns?], Journal of Object Technology
 
In each definition, the implementer of the anti-pattern is trying to solve a problem in a common way, however the common way is a bad design that can lead to unintended consequences. Some of the reasons cited in the '''[http://www.amazon.com/exec/obidos/ASIN/0471197130/theantipatterngr AntiPatterns]''' book as to why these anti-patterns have been used include: Haste, sloth (or laziness), ignorance, apathy, and pride. Studying anti-patterns can at least help assist the potential anti-pattern implementer in the ignorance category.


== Considerations When Writing Anti-Patterns ==
== Considerations When Writing Anti-Patterns ==

Revision as of 22:14, 17 November 2009

Software Design Anti-Patterns

  Not all patterns are good. Anti-patterns are patterns that initially seem effective, but over time you learn that they lead you into traps. 
      - Scott Klement, Anti-Patterns: Avoid the Programming Dark Side

In this article, we will describe several software design patterns which have been categorized as "anti patterns": Programming approaches which are not uncommon and which can lead to poor program design and performance.

What are Anti-Patterns?

Different texts define the term anti-patterns in different ways:

In each definition, the implementer of the anti-pattern is trying to solve a problem in a common way, however the common way is a bad design that can lead to unintended consequences. Some of the reasons cited in the AntiPatterns book as to why these anti-patterns have been used include: Haste, sloth (or laziness), ignorance, apathy, and pride. Studying anti-patterns can at least help assist the potential anti-pattern implementer in the ignorance category.

Considerations When Writing Anti-Patterns

text

Anti-Pattern Examples

text

The Blob or God Class

Anti-Pattern Problem

text

Refactored Solution

text

Example

text

Lava Flow

Anti-Pattern Problem

text

Refactored Solution

text

Example

text

Poltergeists

Anti-Pattern Problem

text

Refactored Solution

text

Example

text

Golden Hammer

Anti-Pattern Problem

text

Refactored Solution

text

Example

text

Spaghetti Code

Anti-Pattern Problem

text

Refactored Solution

text

Example

text

Cut-and-Paste Programming

Anti-Pattern Problem

text

Refactored Solution

text

Example

text

Conclusion

text

References