Design Patterns

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/68

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

69 Terms

1
New cards

Creational Design Patterns

This type of patterns support the creation of objects.

2
New cards

Abstract Factory

This creational design pattern provides an interface for creating families of related or dependent objects without the need to specify their concrete classes.

3
New cards

Factory Method

This creational design pattern defines an interface for object creation but lets the subclass decide which object to create.

4
New cards

Builder

This creational design pattern enables a more readable object creation and lets you specify the fields that are actually needed.

5
New cards

Prototype

This creational design pattern helps if objects are expensive to create and new objects will be similar to existing objects.

6
New cards

Clone

The prototype design pattern uses this method to duplicate existing instances to be used as a prototype for new instances.

7
New cards

Singleton

A This creational design pattern ensures that only one instance of an object is created and that this instance is globally accessible.

8
New cards

Logging

Logging is one meaningful example for the Singleton as the information flow happens only in one direction and therefore global state is not a big issue.

9
New cards

Structural Design Patterns

These type of pattern helps to design relationships between objects

10
New cards

Adapter

This structural design pattern works between two independent or incompatibale interfaces

11
New cards

Bridge Pattern

This structural design pattern is used to decouple interfaces from implementations, if there are hierarchies in interfaces as well as implementations.

12
New cards

Composite Pattern

A design pattern that allows you to compose objects into tree structures to represent part-whole hierarchies.

13
New cards

Decorator Pattern

A design pattern that allows behavior to be added to individual objects, either statically or dynamically, without affecting the behavior of other objects from the same class.

14
New cards

Facade Pattern

A design pattern that provides a simplified interface to a complex subsystem.

15
New cards

Flyweight Pattern

A design pattern that minimizes memory usage by sharing as much data as possible with similar objects.

16
New cards

Proxy Pattern

A design pattern that provides a surrogate or placeholder for another object to control access to it.

17
New cards

Chain of Responsibility

A design pattern that allows an object to send a command without knowing which object will receive and handle it.

18
New cards

Command

A design pattern that encapsulates a request as an object, thereby allowing for parameterization of clients with queues, requests, and operations.

19
New cards

Interpreter

A design pattern that defines a representation for a language's grammar along with an interpreter that uses the representation to interpret sentences in the language.

20
New cards

Iterator

A design pattern that provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.

21
New cards

Mediator

A design pattern that defines an object that encapsulates how a set of objects interact.

22
New cards

Observer

A design pattern that defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

23
New cards

Strategy

A design pattern that defines a family of algorithms, encapsulates each one, and makes them interchangeable.

24
New cards

Template

A design pattern that defines the skeleton of an algorithm in a method, deferring some steps to subclasses.

25
New cards

Visitor

A design pattern that lets you separate algorithms from the objects on which they operate.

26
New cards

Null Object

A design pattern that uses a special object to represent a null reference.

27
New cards

State

A design pattern that allows an object to alter its behavior when its internal state changes.

28
New cards

Memento

A design pattern that allows for the capture and externalization of an object's internal state so that the object can be restored to this state later.

29
New cards

Singleton

The private constructor in the example ensures that the object creation only happens through getInstance() which at the same time serves as the global accessor.

30
New cards

Structural Design Patterns

These type of pattern helps to design relationships between objects.

31
New cards

Adapter

The Adapter Pattern works between two independent or incompatible interfaces.

32
New cards

Bridge

This structural design pattern is used to decouple interfaces from implementations, if there are hierarchies in interfaces as well as implementations.

33
New cards

Composite

This structural design pattern allows to treat a group of objects the same way as a single object.

34
New cards

Composite Example

This structural design pattern is for example used in tree-like object structures where a parent node's operation influences or is dependent on child nodes.

35
New cards

Decorator

This structural design pattern allows to add functionality to an object at run-time without altering its structure.

36
New cards

Facade

This structural design pattern provides a simplified interface to a complex subsystem of classes, making it easier to use.

37
New cards

Flyweight

This structural design pattern is applied if lots of objects from one class need to be constructed. Objects are shared to reduce the memory load

38
New cards

Proxy

This structural design pattern acts as a substitute or placeholder for another object to control access to it.

39
New cards

Serialization

This is the interface that allows you to serialize a class.

40
New cards

Transient

This is the keyword used so you don't include this field in serialization.

41
New cards

True

True or False

You can no longer deserialize the object when you modify the method's name in the serialized class.

42
New cards

False

True or False

You can no longer deserialize the object when you modify the method's body in the serialized class.

43
New cards

readObject

What method of ObjectOutputStream is used to deserialize an object?

44
New cards

Facade

This Structural Pattern is used to harmonize different interfaces for the main interface to seem simple.

45
New cards

Prototype

This Creational Pattern helps if objects are expensive to create and new objects will be similar to existing objects.

46
New cards

Decorator

This Structural Pattern allows to add functionality to an object at run-time without altering its structure.

47
New cards

Flyweight

This Structural Pattern is applied if lots of objects from one class need to be constructed where objects are shared.

48
New cards

Builder

This Creational Pattern enables a more readable object creation and lets you specify the fields that are actually needed.

49
New cards

Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Observer, Strategy, Template, Visitor, Null Object, State, Memento

Name 12 behavioral design patterns

50
New cards

Chain of Responsibility

A way of passing a request between a chain of objects.

51
New cards

Chain of Responsibility

This Behavioral Design Pattern allows an object to send a command without knowing what object will receive and handle it.

52
New cards

Command

This Behavioral Design Pattern encapsulate a command request as an object, allowing requests to be issued without knowing the requested operation or the requesting object.

53
New cards

Interpreter

This Behavioral Design Pattern is a way to include language elements in a program by defining a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.

54
New cards

Interpreter

Maps a domain to a language, the language to a grammar, and the grammar to a hierarchical object-oriented design.

55
New cards

Interpreter Implementation

This Behavioral Design Pattern is just the use of the composite pattern applied to represent a grammar.

56
New cards

Iterator

This Behavioral Design Pattern is used to sequentially access the elements of a collection, which is just a grouping of some objects.

57
New cards

Mediator

This Behavioral Design Pattern defines simplified communication between classes.

58
New cards

Observer

This Behavioral Design Pattern is a way of notifying change to a number of classes.

59
New cards

one-to-many

Obsever defines what cardinality dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

60
New cards

Strategy

This Behavioral Design Pattern encapsulates an algorithm inside a class.

61
New cards

Template Method

This Behavioral Design Pattern defer the exact steps of an algorithm to a subclass. This is a preset format, used as a starting point for a particular application so that the format does not have to be recreated each time it is used.

62
New cards

Template

This Behavioral Design Pattern defines an algorithm in a base class using abstract operations that subclasses override to provide concrete behavior.

63
New cards

Visitor

This Behavioral Design Pattern defines a new operation to a class without change.

64
New cards

Visitor

This Behavioral Design Pattern has an interface used to declare the visit operations for all the types of visitable classes.

65
New cards

Null Object

This Behavioral Design Pattern is designed to act as a default value of an object, used when a system may or may not need to use certain functionalities.

66
New cards

State

This Behavioral Design Pattern alters an object's behavior when its state changes, allowing the object to appear to change its class.

67
New cards

Memento

This Behavioral Design Pattern captures and restores an object's internal state, useful in case of error or failure.

68
New cards

Originator

Creates a memento object capturing its internal state and uses the memento object to restore its previous state.

69
New cards

Caretaker

Responsible for keeping the memento, which is opaque to the caretaker, preventing any operations on it.