What makes an Expert? I believe its Experience. It’s all those times you spend solving problems help you later when the same problem reoccur again. You tend to look into the code you wrote in the last project or in a project few years back. Problems reoccur in a specific context, and they can have various solutions. The best solution can be called an Expert Solution. Design Patterns are those expert solutions to common architectural problems that reoccur in a particular context.
Designing reusable software is very hard. Normally we end up writing voluminous but repetitive code. The task becomes more and more complicated as the project size grows. Design pattern offers to store solutions for typical problems occurring over and over and use the same solution without writing code twice.
Design Patterns helps in solving the day-to-day problems that Object Oriented designers and developers face
- Finding appropriate Objects
- Determining the object granularity
- Specifying the object interfaces
- Specifying the object implementation
- Finding the ideal object collaboration
- Achieving reusability, maintainability, extendibility, scalability and performance
Design Patterns provide out-of-the-box solutions that solve all or part of the above challenges. We have been using Design Patterns in some form or other. It’s probably time to recognize them (Pattern mining), name them and communicate using them (build into UML). It leads towards standardization of common solutions in form of patterns that will result in simplicity in understanding and managing complex systems, of course at the cost of understanding the patterns.
Design patterns capture solutions that have evolved over time as developers strive for greater flexibility in their software. Whereas class libraries are reusable source code, and components are reusable packaged objects, patterns are generic, reusable design descriptions that are customized to solve a specific problem. The study of design patterns provides a common vocabulary for communication and documentation, and it provides a framework for evolution and improvement of existing patterns.
Design Pattern and Framework
Because patterns and frameworks have some similarities, people often wonder how they are different.
- Patterns support reuse of software architecture and design
- Frameworks support reuse of detailed design and code
The key differences between design pattern and framework
A framework is dedicated to a specific application or class of use. So a framework can be implemented in code. A design pattern is more abstract and they are differently implemented under different contexts.
Design pattern is a subset of Framework. A framework may use various design patterns for implementation but the reverse is not true.
Design pattern gives a reusable solution to a recurring problem where as frameworks build the reusable architecture for an application