Object Oriented Design Patterns Flashcards
What are the characteristics of good design?
Maintainable, reusable, understandable, and consistent.
What is a design pattern?
A template with two parts: a design problem and a general solution.
How does an architectural style differ from a design pattern?
An architectural style provides a template for the whole application (high level), while a design pattern provides structure to a subsystem (low level).
What are the benefits of design patterns?
They collect expertise, improve productivity, are language-independent, enhance quality, and make designs more readable.
What are the three main categories of design patterns?
Structural, behavioural, and creational.
What do structural patterns do?
Compose objects to form more complex structures.
What do behavioural patterns focus on?
Dynamic communication between objects.
Name the 8 structural patterns.
Adapter, composite, aggregate, bridge, decorator, facade, flyweight, and proxy.
Name the 11 behavioural patterns.
Chain of responsibility, command, interpreter, template method, iterator, mediator, memento, observer, strategy, state, and visitor.
Name the 5 creational patterns.
Factory, abstract factory, builder, prototype, and singleton.
What is the singleton pattern?
A pattern that ensures a class has only one instance (e.g., the President of a country)
What are the two main parts of a design pattern description?
Problem and solution.
What does the problem part of a design pattern consist of?
Name, the problem it solves, environment, and motivation.
What does the solution part of a design pattern consist of?
Applicability, class diagram, classes involved, class interactions, implementation guidelines, examples, pros and cons, industrial applications, and related patterns.
Where can you find patterns for specific domains?
In web frameworks that come with their own libraries of design patterns.
What is the goal of the facade pattern?
To facilitate the usability of a large and complex software system.
What design problem does the facade pattern solve?
How to provide a simplified, high-level interface to a complex system.