GoF Patterns Flashcards

1
Q

What is the Abstract Factory pattern?

A

Abstract Factory. Allows the creation of objects without specifying their concrete type.

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

What is the Builder pattern?

A

Builder. Uses to create complex objects.

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

What is the Factory Method Pattern?

A

Factory Method. Creates objects without specifying the exact class to create.

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

What is the Prototype Pattern?

A

Prototype. Creates a new object from an existing object.

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

What is the Singleton Pattern?

A

Singleton. Ensures only one instance of an object is created.

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

What is the Adapter Pattern?

A

Adapter. Allows for two incompatible classes to work together by wrapping an interface around one of the existing classes.

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

What is the Bridge Pattern?

A

Bridge. Decouples an abstraction so two classes can vary independently.

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

What is the Composite Pattern?

A

Composite. Takes a group of objects into a single object.

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

What is the Decorator Pattern?

A

Decorator. Allows for an object’s behavior to be extended dynamically at run time.

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

Wha the Facade Pattern?

A

Facade. Provides a simple interface to a more complex underlying object.

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

What is the Flyweight Pattern?

A

Flyweight. Reduces the cost of complex object models.

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

What is the Proxy Pattern?

A

Proxy. Provides a placeholder interface to an underlying object to
1. control access,
2. reduce cost, or
3. reduce complexity.

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

What is the Chain of Responsibility Pattern?

A

Chain of Responsibility. Delegates commands to a chain of processing objects.

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

What is the Command Pattern?

A

Command. Creates objects which encapsulate actions and parameters.

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

What is the Interpreter Pattern?

A

Interpreter. Implements a specialized language.

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

What is the Iterator Pattern?

A

Iterator. Accesses the elements of an object sequentially without exposing its underlying representation.

17
Q

What is the Mediator Pattern?

A

Mediator. Allows loose coupling between classes by being the only class that has detailed knowledge of their methods.

18
Q

What is the Memento Pattern?

A

Memento. Provides the ability to restore an object to its previous state.

19
Q

What is the Observer Pattern?

A

Observer. Is a publish/subscribe pattern which allows a number of observer objects to see an event.

20
Q

What is the State Pattern?

A

State. Allows an object to alter its behavior when its internal state changes.

21
Q

What is the Strategy Pattern?

A

Strategy. Allows one of a family of algorithms to be selected on-the-fly at run-time.

22
Q

What is the Template Method Pattern?

A

Template Method. Defines the skeleton of an algorithm as an abstract class, allowing its sub-classes to provide concrete behavior.

23
Q

What is the Visitor Pattern?

A

Visitor. Separates an algorithm from an object structure by moving the hierarchy of methods into one object.