Design Patterns Flashcards
(49 cards)
What are the 3 Categories of Design Patterns
- Behavioral
- Creational
- Structural
How many Creational Design Patterns are there? Name them in order.
There are 5 Creational Design Patterns:
- Abstract Factory
- Builder
- Factory
- Prototype
- Singleton
(Abraham Became First President of States)
True or False:
An air traffic controller is a real-life corollary to the
False.
An air traffic controller is an example of the Mediator Behavioral pattern.
Which Design Pattern is defined as:
A fully initialized instance to be copied or cloned?
The Prototype pattern
Which Design Pattern correlates to an initial chess game setup?
The Prototype pattern
True or False:
The Prototype Design Pattern separates object construction from its representation
False.
The Builder pattern separates object construction from its representation
Which Design Pattern correlates to a multi-course dinner (e.g., drinks, appetizer, main course, etc.)?
The Builder pattern correlates to a multi course dinner.
Which Design Pattern is characterized as having only one instance of a particular class?
The Singleton Pattern
True or False: The java.lang.system class is an example of the Singleton pattern.
True
How many Structural Design Patterns are there? Name them.
There are 6 Structural Design Patterns.
- Adapter
- Bridge
- Composite
- Decorator
- Facade
- Flyweight
- Proxy
(“Now I know by ABC’s song: A-B-C-D-F-F-P… “)
Which Design Pattern correlates to a debit card in relation to a bank?
The Proxy pattern
Which Design Pattern is defined as:
An object representing another object?
The Proxy pattern
Which Design Pattern is defined as:
Adding responsibilities to objects dynamically?
The Decorator pattern
Which Design Pattern correlates to a multiple types of pizza with multiple toppings for each
The Decorator pattern
Which Design Pattern correlates to adding a discount to a sale
The Decorator pattern
LineNumberInputStream and BufferedInputStream are two examples of what pattern?
The Decorator pattern
True or False:
An event manager for a party is an example of the Facade pattern
True
Which Design Pattern correlates to a multi-country power adapter?
The Adapter pattern
Which Design Pattern is defined as:
A fine-grained instance used for efficient sharing
The Flyweight pattern
How many Behavioral Design Patterns are there? Name them.
There are 11 Behavioral Design Patterns:
- Method
- Iterator
- Chain of Responsibility
- State
- Mediator
- Interpreter
- Command
- Strategy
- Observer
- Template Method
- Visitor
(“2 Mics On TV” : MiCSMICSOTV)
Exception handling is an example of which Design Pattern?
The Chain of Responsibility pattern
Channel surfing with the “Channel Up / Down” buttons is an example of what pattern?
The Iterator pattern
Which Design Pattern is defined as:
Alter an object’s behavior when its state changes
The State pattern
A ceiling fan wall control is an example of which Design Pattern
The State pattern