Exam 3 Design Patterns Flashcards

1
Q

Creates an instance of several families of classes

A

Abstract Factory

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

Allows the same construction process to create different representations

A

Builder

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

Creates an instance of several possible derived classes

A

Factory Method

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

Restricts Instantiation of a class to a single instance

A

Singleton

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

5 Creational Patterns

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

7 Structural Patterns

A
Adapter
Bridge
Composite
Decorator
Facade
Flyweight
Proxy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
Matches interfaces of different classes
Decouples an abstraction from its implementation
A class that is the composition of similar classes
Allows additional behavior to be dynamically added to a class
A single class that provides a simplified interface
Uses sharing to support large numbers of fine-grained classes efficiently
A

Adapter

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

A class functioning as an interface

A

Proxy

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

11 Behavioral Patterns

A
Chain of Responsibility
Command
Interpreter 
Iterator
Mediator
Memento
Observer
State
Strategy
Template Method
Visitor
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A way of processing a request by a chain of classes

A

Chain of Responsibility

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

Encapsulates an action within a class

A

Command

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

A way to implement specialized language element

A

Interpreter

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

Sequentially access the elements of a collection

A

Iterator

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

Provides a unified interface to set of interfaces

A

Mediator

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

Captures and restores an object internal state

A

Memento

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

Allows the obesrvation of the state of an object at run time

A

Observer

17
Q

Allows an object to partially hcange its type at run time

A

State

18
Q

Allows an algorithm to be dynamically selected at run time

A

Strategy

19
Q

Defers implementation of an algorithm to its subclass

A

Template Method

20
Q

Adds new oprations to a class without changing it

A

Visitor

21
Q

Strengths of Design Pattern

A
  1. Promote Reuse
  2. High-Level Documentation
  3. Implementations of many design patterns already exist
  4. Easy Comprehension
  5. Possible automated design pattern detection
22
Q

The weakness of Design Patterns

A
  1. No systematic way to determine when and how to apply patterns
  2. Must use multiple patterns for maximum benefit
  3. Impossible to implement patterns in existing code