0
0
Software Engineeringknowledge~5 mins

Structural patterns (Adapter, Decorator, Facade) in Software Engineering - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the main purpose of the Adapter pattern?
The Adapter pattern helps two incompatible interfaces work together by converting the interface of one class into another that clients expect.
Click to reveal answer
beginner
How does the Decorator pattern add functionality to an object?
The Decorator pattern wraps an object with another object that adds new behavior or responsibilities without changing the original object's code.
Click to reveal answer
beginner
What problem does the Facade pattern solve?
The Facade pattern provides a simple interface to a complex system, making it easier to use by hiding the system's complexity behind a single unified interface.
Click to reveal answer
intermediate
Which structural pattern would you use to make two incompatible classes work together without changing their code?
You would use the Adapter pattern because it acts as a bridge between incompatible interfaces.
Click to reveal answer
beginner
Can the Decorator pattern change the original object's code?
No, the Decorator pattern adds new behavior by wrapping the original object, leaving its code unchanged.
Click to reveal answer
Which pattern provides a simplified interface to a complex system?
AAdapter
BFacade
CDecorator
DObserver
What does the Adapter pattern do?
AConverts one interface to another
BAdds new behavior by wrapping objects
CSimplifies complex systems
DManages object creation
Which pattern allows adding responsibilities to objects dynamically?
AFacade
BAdapter
CDecorator
DSingleton
If you want to hide complex subsystem details from clients, which pattern should you use?
AAdapter
BFactory
CDecorator
DFacade
Which pattern is best for making two incompatible interfaces work together?
AAdapter
BFacade
CDecorator
DProxy
Explain the differences between Adapter, Decorator, and Facade patterns with examples.
Think about how each pattern changes or hides complexity.
You got /3 concepts.
    Describe a real-life scenario where you would use the Facade pattern.
    Consider something like a home entertainment system or a car dashboard.
    You got /3 concepts.