Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between the design pattern and anti-pattern

I'm reading the theory about designing software architecture and I see there are some theories such as SOLID principles, Design Pattern and Anti-Pattern that we should consider when we design our software.

My Question: What are the differences between the Design Pattern and Anti-Pattern and what problem they solve?

like image 297
Ahmad Payan Avatar asked Mar 08 '23 06:03

Ahmad Payan


1 Answers

Simple Difference would be:

Design Patterns:

Solutions which are productive and efficient and are developed by Software Engineers over the years of practice and solving problems.

Anti Patterns:

Known solutions which are actually bad or defective to certain kind of problems.

From Wikipedia:

An anti-pattern is a common response to a recurring problem that is usually ineffective and risks being highly counterproductive.[1][2] The term, coined in 1995 by Andrew Koenig,[3] was inspired by a book, Design Patterns, which highlights a number of design patterns in software development that its authors considered to be highly reliable and effective.

The term was popularized three years later by the book AntiPatterns, which extended its use beyond the field of software design to refer informally to any commonly reinvented but bad solution to a problem. Examples include analysis paralysis, cargo cult programming, death march, groupthink and vendor lock-in.

Example of some anti patterns:

  1. https://javaantipatterns.wordpress.com/
  2. https://sourcemaking.com/antipatterns

Hope this makes sense.

like image 191
Pritam Banerjee Avatar answered Mar 23 '23 13:03

Pritam Banerjee