Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do we need design patterns

Why do we need design patterns like Factory, Abstract Factory and Singleton?

like image 269
0cool Avatar asked Feb 24 '10 05:02

0cool


2 Answers

Design Patterns provide easy to recognize and use OOP solutions to common problems. They're inherently easy to maintain, because many people are familiar with them. This is very similar to how google works. Everyone knows HOW to google, so when you get a query like "What is the purpose of design patterns", you can very quickly use this common interface to solve a problem.

Design Patterns also solve specific programming challenges regarding usability and maintainability. Pick up the Gang of Four book and have a look at it.

like image 67
Stefan Kendall Avatar answered Sep 29 '22 06:09

Stefan Kendall


If a problem occurs over and over again, a solution to that problem has been used effectively. That solution is described as a pattern.

like image 20
Palraj JP Avatar answered Sep 29 '22 08:09

Palraj JP