You are on page 1of 2

ASSIGNMENT SDA

Name: - Muhammad Aqib Sap Id: - 2381


Assignment Topic: -
Difference Between Façade and Adapter Pattern:
Façade Pattern Adapter Pattern
The Facade pattern is used when a simpler The Adapter design pattern is meant to
interface is wanted (and again, could be 'translate' the interface of one or more
implemented the same way by wrapping the classes into an interface that the client
offending classes.) expects to use.
Wouldn’t say you're using a facade when Adapter would translate the calls to the
the existing interface is incompatible, just expected interface into the actual interface
when you need to make it more readable, the wrapped classes use.
less poorly-designed, etc.
Facade defines a new interface Whereas Adapter uses an old interface
Simplifies multiple complex components Provides different interface for an interface
with single interface

Works with multiple components Works with single component

Control panel is an example A power adapter is an example

High-level interface Low-level interface

The purpose of a facade is simplicity The purpose of a adapter is interoperability

A facade is used to encapsulate an entire An adapter is used, where you have two
layer, and offer some methods to access it components that should already work
"conveniently" together, but don't, only because of some
"unimportant" differences in the interface.
Facade pattern can be applied at any point It makes things work after they're designed
of development

Façade Pattern Class Diagram: -


Adapter Pattern Class Diagram: -

You might also like