Design Pattern have two main usages:
- Common language for developers: They provide developers a common language for certain problems. For example if a developer tells another developer that he is using a Singleton, the another developer (should) know exactly what this means.
- Capture good practices: Design patterns capture solutions which have been successfully applied to problems. By learning these patterns and the related problem, an unexperienced developer learns a lot about software design.
Advantages of using design patterns are:
- Design patterns help you analyze the more abstract areas of a program by providing concrete, well-tested solutions.
- Design patterns help you write code faster by providing a clearer picture of how you're implementing the design.
- Design patterns encourage code reuse and accommodate change by supplying well-tested mechanisms for delegation and composition, and other non-inheritance based reuse techniques.
- Design patterns encourage more legible and maintainable code by following well-understood paths.
- Design patterns increasingly provide a common language and jargon for programmers.
Types of design patternsDesign Patterns can be divided into three categories – creational, structural, and behavioral design patterns.
Creational Design PatternsThere are five types of Creational Patterns.
- Factory Pattern
- Abstract Factory Pattern
- Builder Pattern
- Prototype Pattern
- Singleton Pattern
Structural Design PatternsThere are seven structural patterns described. They are as follows:
- Adapter Pattern
- Bridge Pattern
- Composite Pattern
- Decorator Pattern
- Facade Pattern
- Flyweight Pattern
- Proxy Pattern
Behavioral Design PatternsThe behavioral patterns are:
- Chain of Resposibility Pattern
- Command Pattern
- Interpreter Pattern
- Iterator Pattern
- Mediator Pattern
- Momento Pattern
- Observer Pattern
- State Pattern
- Strategy Pattern
- Template Pattern
- Visitor Pattern
Hope we are able to explain you Design Patterns, if you have any questions or suggestions please write to us using contact us form.(Second Menu from top left).
Please share us on social media if you like the tutorial.