Design Patterns I Flashcards
Which are the basic elements of a DP
- Name
- Problem
- Solution
- Consequences
What does the problem describe?
When to apply the pattern and its context
Does patterns universally apply easily for any situation and tech?
No, these abstractions can be more difficult in some languages than others and came across with trade offs.
Does patterns are actually recipes for your problems?
No, they are more like templates that has to customize and later implement
What format does the GoF used to describe patterns
- Name
- Classification
- Intention
- Also known as
- Motivation
- Applicability
- Structure
- Participants
- Collaboration
- Consequences
- Implementation
- Sample
- Known uses
- Related Patterns
What is the “Intention” of a DP
The problem that is trying to resolve and how does it
What is the “Motivation” of a DP
Bad design decision scenario that might make this pattern to born
What is the “Applicability” of a DP
How can you recognize scenarios where there are bad design decision where u can apply the pattern, and other scenarios where you can apply it.
What is the “Structure” of DP
Visual representation of how participants communicate
What are “Participants” and “Collaborations”
The participants are the classes that have a responsibility inside the pattern and collabs are how they request and communicate between they.
What is the “Implementation” of DP
The pitfalls, trade offs and techniques. Including problems with specific languages.
Which are some patterns ing the GoF books (at least mention 6)
- Abstract factory
- Factory
- Bridge
- Adapter
- Builder
- Chain of responsability
- Mediator
- Proxy
- Singleton
- Iterator
- Command
- Facade
- Decorator
- Observer
-Prototype
How are DP classified by purpose?
- Structural
- Behavioral
- Creational
How are DP classified by scope?
Classes (inheritance) and Objects (mostly composition and can be rewired at runtime)