GoF Design Patterns Flashcards

1
Q

Three categories of design patterns

A

creational, structural, and behavioral.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are design patterns?

A

elegant solutions to common problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

4 elements of a design pattern

A
  1. Pattern name
  2. Problem
  3. Solution
  4. Consequences
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

5 creational patterns

A
  1. Abstract Factory
  2. Builder
  3. Factory Method
  4. Prototype
  5. Singlton
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Creational Patterns

A

Creational patterns provide various object creation mechanisms, which increase flexibility and reuse of existing code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly