What could be a potential drawback of using the Flyweight pattern?
Reduced code readability due to the separation of intrinsic and extrinsic state.
Slower performance because of the overhead of managing shared objects.
Increased memory consumption due to object duplication.
Limited flexibility in handling object variations and customizations.
How does the State Pattern typically handle state transitions?
The 'Context' object directly modifies its internal state.
A separate 'State Manager' class controls all transitions.
State transitions are determined by external events only.
State objects have methods to trigger transitions to other states.
What type of relationship does the Composite pattern leverage to represent the parent-child structure?
Inheritance
Aggregation
Dependency
Composition
How does the Iterator Pattern contribute to code maintainability?
By centralizing object creation logic.
By encapsulating the iteration logic and abstracting the aggregate structure, making changes to either independently easier.
By defining a family of algorithms and making them interchangeable.
By providing a global point of access to a single instance.
Which of the following is a key characteristic of a Proxy object in the Proxy Pattern?
It cannot modify the behavior of the real subject object.
It must implement a different interface than the real subject object.
It always has direct access to the real subject object.
It provides an identical interface to the real subject object.
How does a Virtual Proxy primarily enhance performance?
By providing a simplified representation of a complex object structure.
By storing copies of frequently accessed data to avoid repeated retrieval.
By delaying the creation of expensive objects until they are actually needed.
By restricting access to the real subject based on user permissions.
How does the Composite pattern promote code reusability?
By encapsulating object creation logic.
By ensuring that a class has only one instance.
By allowing objects to change their behavior at runtime.
By providing a common interface for interacting with simple and complex objects.
In a GUI toolkit using the Composite pattern, what would a 'Dialog Box' be considered?
Composite
Client
Iterator
Leaf
Which principle of object-oriented design does the Builder Pattern primarily promote?
Dependency Inversion Principle
Single Responsibility Principle
Open/Closed Principle
Liskov Substitution Principle
In the State Pattern, what does the 'Context' class represent?
The interface or abstract class defining state-specific actions.
The concrete classes implementing different states.
The class that holds the current state of the object.
The mechanism for transitioning between states.