What is a design pattern
Description of a problem that reoccurs and an outline of an approach to solving a problem.
What is a framework
partially completed design that can be extended to solve a problem in a domain.
What is an idiom
A small language specific pattern or technique.
Use of Init in constructors
Essential Elements of Design Patterns
Vocabulary of patterns, need to know where to apply patterns, how to represent components and conditions to be met before using. Use Design Elements
Design Elements:
Relations, Responsibilities, Collaborations.
Patterns are;
name and description of proven solution to problem. Documentation of design decision.
Patterns are not;
Reusable code/libraries. Don’t need complex integrations.
Pattern Format
Static Factory Methods
Factory
Something that creates an instance
State Design Pattern
Connection can be in various state requests, handles differently depending on state. Connection delegates request to state object which changes dynamically.