An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context. The architectural patterns address various issues in software engineering, such as computer hardware performance limitations, high availability and minimization of a business risk.
Design pattern is a documented best practice of a solution that has been applied successfully to solve a problem that recurs a specific set of situations. In a short we can say recuring solution to a common problem in a given context. GOF devide design patterns in 3 types i) Creational Design Pattern: The patterns which are responsible for creating objects. Ex: Factory, Builder, Singleton etc. ii) Structural Design Pattern: The patterns which are responsible for assembles objects. and classes to create better strucutre for efficiency and flexibilities. Ex: Adapter, Bridge, Facade etc. iii) Behaviour Design Pattern: The patters which are assign responsiblities between objects. Ex: State, ChainOfResponsibility, TemplateMethod etc.
Here I demonastrate few important design patterns that can be use in real life application/api development:
- Strategy
- Facade
- Factory
- Singleton
- Specification
- Adapter
- Decorator
- Proxy
- Repository
- Mediator
- NullObject
- ChainOfResponsibility
- Builder
- Template Method
- State
- Observer