How does the Builder Pattern differ from using telescoping constructors?
The Builder Pattern provides better control and clarity when building objects with many attributes.
The Builder Pattern is less flexible when dealing with optional attributes.
Telescoping constructors are more readable for a large number of attributes.
Telescoping constructors are preferred when the object construction is complex.
Which of these is NOT a potential benefit of using the Composite pattern?
Increased code complexity.
Open/Closed Principle adherence.
Flexibility in object structure.
Uniform treatment of objects.
What is a potential drawback or consideration when using the Prototype Pattern?
It can make the codebase overly complex.
It might lead to shallow copies of objects if not implemented carefully.
It is not suitable for languages that do not support object-oriented programming.
It violates the Single Responsibility Principle.
What is a key difference between a deep copy and a shallow copy in the context of the Prototype Pattern?
A shallow copy duplicates references, while a deep copy creates new instances for nested objects.
A deep copy is faster to execute than a shallow copy.
A deep copy is only applicable to immutable objects.
A shallow copy is preferred when you need to maintain object immutability.
What type of Proxy is used to control access to a resource based on access rights?
Remote Proxy
Caching Proxy
Protection Proxy
Virtual Proxy
In a vending machine simulation using the State Pattern, what would likely be a 'State'?
The act of dispensing a product
The price of a product
The 'Out of Stock' condition
The number of coins inserted
What is the primary purpose of the Proxy Pattern in software design?
To define a family of algorithms and encapsulate each one.
To control access to an object, potentially restricting its use.
To provide a simplified interface to a complex subsystem.
To allow objects to be notified of changes in other objects.
In a GUI toolkit using the Composite pattern, what would a 'Dialog Box' be considered?
Client
Iterator
Leaf
Composite
Which core method is typically associated with the Prototype Pattern?
create()
clone()
copy()
getInstance()
What could be a potential drawback of applying the Composite pattern?
It makes adding new leaf objects difficult.
It increases coupling between objects.
It can make it harder to restrict operations on specific component types.