Which of the following is NOT a core participant in the Iterator Pattern?
Factory
Iterator
ConcreteIterator
Aggregate
What could be a potential drawback of using the Flyweight pattern?
Slower performance because of the overhead of managing shared objects.
Limited flexibility in handling object variations and customizations.
Reduced code readability due to the separation of intrinsic and extrinsic state.
Increased memory consumption due to object duplication.
In the context of the Proxy Pattern, what does the term 'subject' refer to?
The client that interacts with the proxy or the real object.
The interface shared by the proxy and the real object.
The object that controls access to the real object.
The object being accessed through the proxy.
What is the primary goal of the Prototype Pattern?
To provide a way to access elements of an aggregate object sequentially.
To ensure a class has only one instance.
To avoid costly creation of objects by copying existing ones.
To define a family of algorithms, encapsulate each one, and make them interchangeable.
What is the primary goal of the Flyweight pattern?
To encapsulate algorithms in objects, allowing for easy swapping and extension.
To provide a way to access shared objects in a synchronized manner.
To minimize memory usage by sharing common data among multiple objects.
Which principle of object-oriented design does the Iterator Pattern promote by decoupling the traversal mechanism from the aggregate object?
Single Responsibility Principle
Open/Closed Principle
Dependency Inversion Principle
Liskov Substitution Principle
What is a potential drawback or consideration when using the Iterator Pattern?
It violates the Single Responsibility Principle.
Increased code complexity in some cases.
It is not suitable for all types of collections.
It leads to tight coupling between classes.
In a typical Iterator Pattern implementation, what is the role of the 'ConcreteIterator' class?
It implements the Iterator interface and provides the concrete implementation for iterating over a specific aggregate object.
It represents the collection of objects being iterated over.
It defines the interface for accessing and traversing elements.
It creates objects without exposing the instantiation logic to the client.
How does a Virtual Proxy primarily enhance performance?
By providing a simplified representation of a complex object structure.
By delaying the creation of expensive objects until they are actually needed.
By restricting access to the real subject based on user permissions.
By storing copies of frequently accessed data to avoid repeated retrieval.
How does the State Pattern typically handle state transitions?
The 'Context' object directly modifies its internal state.
State objects have methods to trigger transitions to other states.
State transitions are determined by external events only.
A separate 'State Manager' class controls all transitions.