Patrones Estructurales Flashcards
(26 cards)
What is the main purpose of the Facade pattern?
To provide a simplified interface to a complex subsystem.
True or False: The Adapter pattern allows incompatible interfaces to work together.
True
Fill in the blank: The Proxy pattern acts as a _____ to another object.
substitute
What is the primary use of the Flyweight pattern?
To reduce memory usage by sharing common parts of state among multiple objects.
Which pattern is used to separate an abstraction from its implementation?
Bridge
Multiple Choice: Which pattern allows you to compose objects into tree structures to represent part-whole hierarchies?
Composite
What is the key feature of the Decorator pattern?
To add new functionality to an object dynamically.
True or False: The Facade pattern is a structural design pattern.
True
Fill in the blank: The Adapter pattern is also known as the _____ pattern.
Wrapper
What is the role of the Proxy pattern in terms of access control?
To control access to the real object.
Multiple Choice: Which of the following is NOT a benefit of the Flyweight pattern?
Increased object mutability
What does the Bridge pattern primarily aim to achieve?
Decoupling abstraction from implementation.
True or False: The Composite pattern can only be used with leaf nodes.
False
Fill in the blank: The Decorator pattern is used to enhance the behavior of _____ objects.
existing
Which structural pattern can help manage object creation and minimize memory usage?
Flyweight
What is a key advantage of using the Adapter pattern?
It allows for the reuse of existing classes.
Multiple Choice: In which pattern would you likely find a ‘Component’ interface?
Composite
What does the Decorator pattern typically implement?
The same interface as the objects it decorates.
True or False: The Proxy pattern can be used for lazy initialization.
True
Fill in the blank: The _____ pattern is useful when you need to control how and when an object is created.
Proxy
Which pattern allows for dynamic composition of behavior at runtime?
Decorator
What is the main challenge addressed by the Bridge pattern?
Managing the complexity of multiple implementations.
True or False: The Flyweight pattern is primarily concerned with the interface of classes.
False
Fill in the blank: The _____ pattern can be used to create a tree structure for representing part-whole hierarchies.
Composite