Structural Patterns Flashcards

1
Q

What is the purpose of the ‘Adapter’ pattern?

A

Converts the interface of a class into another interface the client expect.

Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces.

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

What is the purpose of the ‘Composite’ pattern?

A

Composes objects into tree structures to represent part-whole hierarchies.

Composite lets clients treat individual objects and compositions of objects uniformly.

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

What is the purpose of the ‘Decorator’ pattern?

A

Attaches additional responsibilities to an object dynamically.

Decorators provide a flexible alternative to subclassing for extending functionality.

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

What is the purpose of the ‘Facade’ pattern?

A

Provides a unified interface to a set of interfaces in a subsystem.

Facade defines a higher-level interface that makes the subsystem easier to use.

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

What is the purpose of the ‘Flyweight’ pattern?

A

Uses sharing to support large numbers of fine-grained objects efficiently.

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

What is the advantage of using a ‘Decorator’ pattern?

A

Decorators provide a flexible alternative to subclassing for extending functionality.

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

What is the advantage of using a ‘Composite’ pattern?

A

Composite lets clients treat individual objects and compositions of objects uniformly.

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

What is the advantage of using a ‘Facade’ pattern?

A

Facade defines a higher-level interface that makes the subsystem easier to use.

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

What is the advantage of using a ‘Adapter’ pattern?

A

Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces.

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