In the Adapter Pattern, what is the 'Adaptee'?
The class that needs to be adapted to a different interface.
The client code that interacts with the adapter.
The interface that the client expects to use.
The class that implements the Adapter Pattern.
In a scenario where you are designing a game with different enemy types, how might the Factory Method pattern be applied?
Use a dependency injection framework to inject concrete enemy instances into the game logic.
Create a single factory class responsible for instantiating all enemy types based on given parameters.
Define an abstract 'EnemyFactory' with a 'createEnemy' method, and have subclasses for each enemy type implement their creation logic.
Hardcode the instantiation of each enemy type directly within the game logic where needed.
How does the Factory Method pattern typically handle the instantiation of concrete objects?
It delegates the instantiation to separate builder classes.
Subclasses override the factory method to provide their own creation logic.
It relies on dependency injection to provide concrete object instances.
It uses a chain of conditional statements within the factory method.
Which of these is NOT a core component of the Strategy Pattern?
Context
Factory
ConcreteStrategy
Strategy
What is the primary intent of the Facade Pattern in software design?
To expose low-level implementation details to clients.
To define a family of algorithms and encapsulate each one.
To create new functionalities within existing classes.
To provide a simplified interface to a complex subsystem.
Which of these is a common real-world analogy used to explain the Decorator Pattern?
A chain of objects processing a request sequentially.
Adding toppings to a base coffee or ice cream.
A tree structure representing hierarchical relationships.
A factory producing different types of objects.
Which principle of object-oriented design does the Adapter Pattern primarily promote?
Polymorphism
Inheritance
Composition
Encapsulation
In a text editor, which of these actions would be a good candidate for implementing with the Command Pattern?
Displaying a warning message when the user attempts to close the editor without saving.
Changing the font size of the selected text.
Checking for spelling errors in the background.
Rendering the text on the screen.
What is the primary intent of the Strategy Pattern in software design?
To provide a way to access elements of an aggregate object sequentially.
To define a family of algorithms and encapsulate each one for interchangeable use.
To ensure that a class has only one instance and provides a global point of access to it.
To encapsulate data and behavior together in a single unit.
Which of the following is NOT a typical use case for the Adapter Pattern?
Using third-party libraries with incompatible interfaces.
Implementing a new sorting algorithm for a data structure.
Creating a reusable component that can work with various data sources.
Integrating legacy code with a modern system.