Black Magic of Design Patterns

Why Patterns?
Design Patterns we have heard this name many times, we also come across many variants of it for various use cases and applications, however, why think of patterns is something that is less understood or asked about. We feel why to ask this simple question which is, in fact, the basis of this subject. Patterns didn't start with the GoF; they started with Christopher Alexander, a Professor of Architecture at Berkeley - that's right, Alexander is an architect, not a computer scientist [Head first Design Patterns]. However, I feel patterns are not limited to Alexanders or the GOF's book, they exist naturally in nature and the software we design. In the natural world, we come across many patterns, complex or simple, however, it is well understood that all complex patterns are formed with the interconnection of the simple ones and most of these patterns in the natural world extend boundlessly. e.g. a tree has roots, branches, leaves, and flowers, each has its own life cycle except the roots, this shows similarities to the Composite design pattern where you compose from a natural set of expressions or methods at the root a then streamline as you go along. Hence it's necessary to understand and exercise these patterns to build complex systems which can be reliable and sustainable.
The principles
SOLID: is a mnemonic acronym for five design principles intended to make software designs more understandable, flexible and maintainable. The principles are a subset of many principles promoted by American software engineer and instructor Robert C. Martin [wikipedia]. The principles are described below.

Pillars of OOPS

Classification of Patterns

Some Useful patterns - Code in Git hub
- Thread Safe Singleton
- Observer
- Mediator
- Factory
- Decorator
- Strategy
- Bridge
- Adapter
- Composite
- Command