Patrones Estructurales Flashcards

(26 cards)

1
Q

What is the main purpose of the Facade pattern?

A

To provide a simplified interface to a complex subsystem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or False: The Adapter pattern allows incompatible interfaces to work together.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Fill in the blank: The Proxy pattern acts as a _____ to another object.

A

substitute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the primary use of the Flyweight pattern?

A

To reduce memory usage by sharing common parts of state among multiple objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which pattern is used to separate an abstraction from its implementation?

A

Bridge

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Multiple Choice: Which pattern allows you to compose objects into tree structures to represent part-whole hierarchies?

A

Composite

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the key feature of the Decorator pattern?

A

To add new functionality to an object dynamically.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

True or False: The Facade pattern is a structural design pattern.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Fill in the blank: The Adapter pattern is also known as the _____ pattern.

A

Wrapper

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the role of the Proxy pattern in terms of access control?

A

To control access to the real object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Multiple Choice: Which of the following is NOT a benefit of the Flyweight pattern?

A

Increased object mutability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the Bridge pattern primarily aim to achieve?

A

Decoupling abstraction from implementation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

True or False: The Composite pattern can only be used with leaf nodes.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Fill in the blank: The Decorator pattern is used to enhance the behavior of _____ objects.

A

existing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which structural pattern can help manage object creation and minimize memory usage?

A

Flyweight

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a key advantage of using the Adapter pattern?

A

It allows for the reuse of existing classes.

17
Q

Multiple Choice: In which pattern would you likely find a ‘Component’ interface?

18
Q

What does the Decorator pattern typically implement?

A

The same interface as the objects it decorates.

19
Q

True or False: The Proxy pattern can be used for lazy initialization.

20
Q

Fill in the blank: The _____ pattern is useful when you need to control how and when an object is created.

21
Q

Which pattern allows for dynamic composition of behavior at runtime?

22
Q

What is the main challenge addressed by the Bridge pattern?

A

Managing the complexity of multiple implementations.

23
Q

True or False: The Flyweight pattern is primarily concerned with the interface of classes.

24
Q

Fill in the blank: The _____ pattern can be used to create a tree structure for representing part-whole hierarchies.

25
Multiple Choice: Which design pattern allows you to add responsibilities to objects without modifying their structure?
Decorator
26
What is the main goal of the Adapter pattern?
To make incompatible interfaces compatible.