In the Flyweight pattern, what is the role of the 'intrinsic state'?
An interface that defines operations for interacting with Flyweights.
Data that is common to multiple objects and can be shared.
Data that is unique to each object and cannot be shared.
A factory method that creates and manages Flyweight objects.
What is the primary goal of the State Pattern in object-oriented programming?
To manage and transition between different states of an object.
To create objects without specifying their concrete classes.
To define a family of algorithms and encapsulate each one.
To provide a way to access elements of an aggregate object sequentially.
In the Builder Pattern, what is the product?
The director class that orchestrates the building process.
The complex object being constructed.
The concrete builder class that assembles the object.
The interface that defines the building steps.
What is the primary goal of the Prototype Pattern?
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.
Which core method is typically associated with the Prototype Pattern?
getInstance()
clone()
copy()
create()
What is the primary intent of the Composite Design Pattern?
To treat individual objects and compositions of objects uniformly.
To provide a way to access the elements of an aggregate object sequentially.
Which principle of object-oriented design does the Builder Pattern primarily promote?
Single Responsibility Principle
Open/Closed Principle
Liskov Substitution Principle
Dependency Inversion Principle
Which of these is NOT a common use case for the Flyweight pattern?
Representing and rendering a complex 3D model with shared textures.
Game development for managing large numbers of units or particles.
Text editors handling character formatting.
Implementing a logging system with different log levels.
A Remote Proxy is typically used for:
Controlling access to the real subject based on user roles.
Providing a local representation of an object in a different process.
Caching the results of expensive operations for performance improvement.
Creating a placeholder for an object that hasn't been fully loaded.
In which scenarios is the Iterator Pattern particularly valuable?
When the internal representation of a collection is subject to change.
When you want to provide a consistent way to traverse elements regardless of the collection type.
All of the above.
When multiple algorithms need to operate on a collection without knowledge of its internal structure.