In the context of the Proxy Pattern, what does the term 'subject' refer to?
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.
The client that interacts with the proxy or the real object.
How does the Flyweight pattern typically handle 'extrinsic state'?
It encapsulates extrinsic state within a separate 'Context' object.
It eliminates the need for extrinsic state altogether.
It passes it as an argument to methods of the Flyweight object.
It stores it within the Flyweight object itself.
In which scenario would the Prototype Pattern be LESS suitable?
When you want to avoid dependencies on concrete product classes.
When you have a large number of objects with minor variations.
When you need to create objects based on a configuration file at runtime.
When object creation is a lightweight operation.
Which of these real-world scenarios could benefit from applying the Iterator Pattern?
Processing a stream of data from a sensor network.
All of the above.
Representing a menu structure in a graphical user interface.
Navigating through a playlist of songs in a music player.
Which of these scenarios is a good candidate for using the Proxy Pattern?
Creating objects that are only instantiated when actually needed.
Defining a one-to-many dependency between objects.
Iterating over a collection of objects without exposing its structure.
Representing a complex object hierarchy in a simplified manner.
Which of these situations is LEAST suitable for applying the Flyweight pattern?
Implementing a particle system with thousands of visually similar particles.
Creating graphical objects for a user interface with varying themes.
Representing characters in a document editor.
Managing a large collection of immutable data points.
What is the primary purpose of the Iterator Pattern in software development?
To define a family of algorithms, encapsulate each one, and make them interchangeable.
To ensure that a class has only one instance and provides a global point of access to it.
To create objects from a class without specifying the exact class to create.
To provide a way to access elements of an aggregate object sequentially without exposing its underlying representation.
In the State Pattern, what does the 'Context' class represent?
The class that holds the current state of the object.
The interface or abstract class defining state-specific actions.
The mechanism for transitioning between states.
The concrete classes implementing different states.
How does the State Pattern typically handle state transitions?
State transitions are determined by external events only.
The 'Context' object directly modifies its internal state.
State objects have methods to trigger transitions to other states.
A separate 'State Manager' class controls all transitions.
What is a potential drawback or consideration when using the Iterator Pattern?
It violates the Single Responsibility Principle.
It is not suitable for all types of collections.
Increased code complexity in some cases.
It leads to tight coupling between classes.