Patterns Flashcards

1
Q

Factory

A

Creational pattern.

Creates objects based on some input data.

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

Abstract Factory

A

Creational pattern.

Creates factories based on some input data.

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

Singleton

A

Creational pattern.

Object with a single instance, available via static method.

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

Builder

A
Creational pattern.
Builds complex item in steps with builder class and helper methods.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Prototype

A

Creational pattern.

Object is created by cloning existing object (to avoid requesting data if it is costly).

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

Adapter / Wrapper

A

Structural pattern.

Object is put inside other object and its methods mapped to the required methods.

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

Bridge

A

Structural pattern.

Multiple classes implement same interface, acting thus as bridge to different realisations.

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

Filter (Criteria)

A

Structural pattern.

Object that filters some data and can be combined with objects which filter the same type of data.

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

Composite

A

Structural pattern.

Used when we need to treat heirarchy of objects as one object.

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

Decorator

A

Structural pattern.

Allows for the dynamic wrapping of objects in order to modify their existing responsibilities and behaviors.

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

Facade

A

Structural pattern.

Hides complexity of some code behind simplified interface.

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

Flyweight

A

Structural pattern.

Reusing existing objects as much as possible to lower memory footprint.

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

Proxy

A

Structural pattern.

Controls and manages access to some other object.

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

Chain of responsibility

A

Behavioral pattern.

Gives more than one object an opportunity to handle a request by linking receiving objects together.

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

Command

A

Behavioral pattern.

Command is sent in a form of object to the other object which can execute it.

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

Interpreter

A

Behavioral pattern.

Describes how one type of data should be converted to some other related type.

17
Q

Iterator

A

Behavioral pattern.

Provides access to the collection without any need to know underlying implementation.

18
Q

Mediator

A

Behavioral pattern.

Object acts as a central hub which manages communication of a group of objects.

19
Q

Memento

A

Behavioral pattern.

Saving state of an object externally to be restored later.

20
Q

Observer

A

Behavioral pattern.

Observable object provides ways for Observers to subscribe to data it emits.

21
Q

State

A

Behavioral pattern.

Behaviour of an object depends on its state.

22
Q

Null

A

Behavioral pattern.

Special object which reflects a do nothing relationship.

23
Q

Strategy

A

Behavioral pattern.

When object changes its behavior depending on external circumstances.

24
Q

Template

A
Behavioral pattern.
Subclasses override methods from class to provide different behaviours.
25
Q

Visitor

A

Behavioral pattern.

Group of objects accept visitor object which describes some logic operations using them, thus externalizing logic.

26
Q

Factory method

A

Creational pattern.

Provides a method to create an instance of the class.

27
Q

Dependency injection

A

Creational pattern.

Class does not create classes it needs for working recieving them from outside instead.

28
Q

Lazy initiation

A

Creational pattern.

Object is only initiated when it is actually needed.

29
Q

Multiton

A
Creational pattern.
Ensures class has only named instances and provides global point of access to get them.
30
Q

Object pool

A

Creational pattern.

Avoid expensive aquisition and release of resources by recycling objects which are no longer in use.