GoF Patterns Flashcards
What is the Abstract Factory pattern?
Abstract Factory. Allows the creation of objects without specifying their concrete type.
What is the Builder pattern?
Builder. Uses to create complex objects.
What is the Factory Method Pattern?
Factory Method. Creates objects without specifying the exact class to create.
What is the Prototype Pattern?
Prototype. Creates a new object from an existing object.
What is the Singleton Pattern?
Singleton. Ensures only one instance of an object is created.
What is the Adapter Pattern?
Adapter. Allows for two incompatible classes to work together by wrapping an interface around one of the existing classes.
What is the Bridge Pattern?
Bridge. Decouples an abstraction so two classes can vary independently.
What is the Composite Pattern?
Composite. Takes a group of objects into a single object.
What is the Decorator Pattern?
Decorator. Allows for an object’s behavior to be extended dynamically at run time.
Wha the Facade Pattern?
Facade. Provides a simple interface to a more complex underlying object.
What is the Flyweight Pattern?
Flyweight. Reduces the cost of complex object models.
What is the Proxy Pattern?
Proxy. Provides a placeholder interface to an underlying object to
1. control access,
2. reduce cost, or
3. reduce complexity.
What is the Chain of Responsibility Pattern?
Chain of Responsibility. Delegates commands to a chain of processing objects.
What is the Command Pattern?
Command. Creates objects which encapsulate actions and parameters.
What is the Interpreter Pattern?
Interpreter. Implements a specialized language.
What is the Iterator Pattern?
Iterator. Accesses the elements of an object sequentially without exposing its underlying representation.
What is the Mediator Pattern?
Mediator. Allows loose coupling between classes by being the only class that has detailed knowledge of their methods.
What is the Memento Pattern?
Memento. Provides the ability to restore an object to its previous state.
What is the Observer Pattern?
Observer. Is a publish/subscribe pattern which allows a number of observer objects to see an event.
What is the State Pattern?
State. Allows an object to alter its behavior when its internal state changes.
What is the Strategy Pattern?
Strategy. Allows one of a family of algorithms to be selected on-the-fly at run-time.
What is the Template Method Pattern?
Template Method. Defines the skeleton of an algorithm as an abstract class, allowing its sub-classes to provide concrete behavior.
What is the Visitor Pattern?
Visitor. Separates an algorithm from an object structure by moving the hierarchy of methods into one object.