What type of Proxy is used to control access to a resource based on access rights?
Virtual Proxy
Remote Proxy
Caching Proxy
Protection Proxy
What is the primary purpose of the Proxy Pattern in software design?
To control access to an object, potentially restricting its use.
To allow objects to be notified of changes in other objects.
To provide a simplified interface to a complex subsystem.
To define a family of algorithms and encapsulate each one.
Which of these is NOT a potential benefit of using the Composite pattern?
Uniform treatment of objects.
Flexibility in object structure.
Increased code complexity.
Open/Closed Principle adherence.
Which of these is NOT a common use case for the Flyweight pattern?
Representing and rendering a complex 3D model with shared textures.
Text editors handling character formatting.
Game development for managing large numbers of units or particles.
Implementing a logging system with different log levels.
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 provide a way to access elements of an aggregate object sequentially without exposing its underlying representation.
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.
Which principle of object-oriented design does the State Pattern primarily promote?
Liskov Substitution Principle
Open/Closed Principle
Single Responsibility Principle
Dependency Inversion Principle
What is the primary goal of the Prototype Pattern?
To avoid costly creation of objects by copying existing ones.
To ensure a class has only one instance.
To provide a way to access elements of an aggregate object sequentially.
What could be a potential drawback of applying the Composite pattern?
It violates the Single Responsibility Principle.
It makes adding new leaf objects difficult.
It increases coupling between objects.
It can make it harder to restrict operations on specific component types.
In which scenario would the Prototype Pattern be LESS suitable?
When you have a large number of objects with minor variations.
When object creation is a lightweight operation.
When you need to create objects based on a configuration file at runtime.
When you want to avoid dependencies on concrete product classes.
In the Flyweight pattern, what is the role of the 'intrinsic state'?
A factory method that creates and manages Flyweight objects.
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.