Exam Flashcards
What classification is the Bridge pattern?
Object Structural
What is the intent of the Bridge pattern?
Decouple an abstraction from its implementation so that the two can vary independently
The Bridge pattern involves what 2 different hierarchies?
- Abstraction
- Implementation
What are the 4 participants in the Bridge pattern?
- Abstraction
- RefinedAbstraction
- Implementor
- ConcreteImplementer
What else is the Bridge pattern known as?
Handle/Body
What does the abstraction class keep reference to in the Bridge pattern?
Object of type Implementor
What would instantiating an object using the Bridge pattern look like?
Abstraction name = new RefinedAbstraction(new ConcreteImplementor)
What are the collaborations for the Bridge pattern?
Abstraction forwards client requests to implementor
What classification is the Decorator pattern?
Object Structural
What is the intent of the Decorator pattern?
Attach additional responsibilities to an object dynamically. An alternative to subclassing
What else is the Decorator pattern known as?
Wrapper
What are the 4 participants of the Decorator pattern?
- Component
- ConcreteComponent
- Decorator
- ConcreteDecorator
What does the Decorator participant maintain reference to?
Component Object
What are the collaborations of the Decorator pattern?
Decorator forwards requests to its component object. It may optionally perform additional operations before and after forwarding requests.
What classification is the State pattern?
Object Behavioural