Design Patterns Flashcards

1
Q

Creational

A
Class instantiation or object creation
Abstract factory
Builder
Method
Prototype
Singleton
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Structural

A
Organizing different classes and objects to form larger structures that provide new functionality
Relationship between objects
Adapter
Bridge
Composite
Decorator
Facade
Flyweight
Proxy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Abstract factory

A

Creational pattern

Produce families of related objects without concrete classes

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

Builder

A

Creational pattern

build a complex object using simple objects and step by step approach

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

Method

A
Creational pattern
provides interface for creating objects in a super class but allow subclass to alter type of object created.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Prototype

A

Clone existing object/clone new instance from prototype

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

Singletone

A
Creational pattern
Ensure only one instance of the class and provide a global access point to this instance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Adapter

A

Structural Pattern

Allow objects with different interfaces to collaborate

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

Bridge

A

Structural Pattern

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

Composite

A

Structural Pattern

Compose objects into tree structure, treat this group of objects similar way to a single object

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

Decorator

A
Structural Pattern
Add new functionality to objects by wrapping it in a decorator class with the new behaviours
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Facade

A

Structural Pattern

provides a simple interface to hide complexity of existing system

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

Flyweight

A

Structural Pattern

Fit more objects into available amount of RAM by sharing common parts of state between multiple objects

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

Proxy

A

Structural Pattern

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

Behaviour Design Pattern

A

Communication or interaction between objects

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

Chain Of Responsibility

A

pass requests along a chain of handlers, each handler decides to process request or pass it to next handler in chain

17
Q

Command

A

object used to encapsulate all information needed to perform action or trigger an event at later time

18
Q

Iterator

A

aggregate and access elements sequentially without exposing its underlying representation

19
Q

Interpreter

A

Language interpreter for a small grammar

20
Q

Mediator

A

restricts direct communication between objects/classes instead uses a mediator object

21
Q

Memento

A

Restore state of object to previous state

22
Q

Observer

A

used in one to many relationships between objects. When one is modified the dependent objects are automatically notified

23
Q

State

A

lets an object alter its behaviour when its internal state changes

24
Q

Strategy

A

selecting algorithm at runtime depending on context object as oppose to having one algorithm, e.g. diff transport modes in nav app

25
Q

Template Method

A

Algorithm with some steps supplied by a derived class

26
Q

Visitor

A

operations applied to elements of a heterogeneous object structure