What is a Design Pattern?
What is a Design Pattern?
Going through the the design patterns book, one of the introductory paragraphs is to define what a design pattern is and why they exist. The book splits it up into the following components:
- Pattern Name and Classification - All design patterns have a name that is universally recognized and can describe it in a small amount of terms.
- Intent - This is a short statement that answers the following
- What does the pattern do?
- What is the rationale and intent?
- What particular design issue or problem are we trying to address?
- Also Known As - Other well-known names this algorithm may go as
- Motivation - A scenario that illustrates a design problem and how the organization of your code can solve a particular problem.
- Applicability- In what situations can this pattern be applied
- Structure - A graphical representation of classes in the pattern and how they interact between objects
- Participants - Classes or objects participating in the design pattern and their responsibilities
- Collaborations - How "participants" carry out their responsibilities
- Implementation - Some pitfalls, hints, and techniques developers should be aware of as they implement these designs in the real world
- Related Patterns - What design patterns are related to this, and important differences that give different benefits to your design.
By learning the building blocks of design patterns, it will allow us to put what we learn into context, and help us categorize them into their role. It will also allow us to compare them to differentiate how patterns are composed differently, or solve other problems.
Following the book along, we'll go through several of the algorithms it describes and take notes based on these categories.
Comments
Post a Comment