The concept of Design Patterns comes from an architect named Christopher Alexander. Back in 1977, he wrote a book called A Pattern Language about the common patterns that he came across while building buildings and towns and cities. Alexanders' concept of design patterns let the world of software enter into the world of Gand of Four, Erich, Richard, Ralph, and John, where they turned his concepts into common patterns for software development in a book called Design Patterns and mostly known as the Gang of Four. According to the book, there are some common problems that developers faced while writing software and then what pattern can help them fix that. For example; creating a service layer to operate on data where there is a separation of the data manipulation from controllers, The Module Pattern can help on tackling this problem. Also, say we have a complicated object, Facade Pattern can be used to abstract the complicated object and make it simpler. What then is design pattern?
Design Patterns are proven concepts that provide description or template for how to solve a problem that can be used in many different situations. So why do we even care about all these design patterns? As programmers, we encounter problems. Once the problem has not been solved, such a person then comes out with a solution to that problem. In case someone faces the similar problem, why solve a problem again? The person then makes use of what has been solved before to solve his problem. Also, we have different developers from different areas like those from functional or object-oriented programming languages, design patterns gives a common vocabulary for them to communicate well as a collective thing.
Let's Get Started?
NB: Part two will focus only on Creational Design Patterns.