GoF Design Patterns Flashcards
1
Q
Three categories of design patterns
A
creational, structural, and behavioral.
2
Q
What are design patterns?
A
elegant solutions to common problems
3
Q
4 elements of a design pattern
A
- Pattern name
- Problem
- Solution
- Consequences
4
Q
5 creational patterns
A
- Abstract Factory
- Builder
- Factory Method
- Prototype
- Singlton
5
Q
Creational Patterns
A
Creational patterns provide various object creation mechanisms, which increase flexibility and reuse of existing code.
6
Q
Abstract Factory: Intent
A
Abstract Factory is a creational design pattern that lets you produce families of related objects without specifying their concrete classes.
7
Q
Abstract Factory: Use When
A
- a system should be independent of how its products are created, composed, and represented.
- a system should be configured with one of multiple families of products.
- a family of related product objects is designed to be used together, and you need to enforce this constraint.
- you want to provide a class library of products, and you want to reveal just their interfaces, not their implementations.