Skip to main content

How does Façade differ from Adapter?

Facade and Adapter really are similar: both create a layer between the client and the system, but they solve different problems.


1. Purpose

  • Facade simplifies working with an already compatible, but complex, system. → makes the interface simpler.
  • Adapter makes incompatible interfaces compatible. → makes the interface fit.

Example:

  • A facade hides dozens of classes behind it (VideoConverter instead of Codec, Reader, Mixer).
  • An adapter fits an old class (OldPlayer) to a new interface (MediaPlayer).

2. Context of Use

SituationWhat fits
Need to reduce API complexityFacade
Need to combine incompatible interfacesAdapter

3. Relationship with the System

  • Facade works with the internal components of a single system - it is an outer shell around a complex module.
  • Adapter connects two different systems that have different interfaces.

4. Changing the Interface

  • Facade leaves the subsystems' interfaces unchanged, simply combining them into a simplified entry point.
  • Adapter translates one interface into another.

5. Analogy

  • Facade is like a hotel reception desk: you don't see the inner workings, you just deal with one staff member.
  • Adapter is like a power plug converter: it makes incompatible plugs compatible.

6. Conclusion

CriterionFacadeAdapter
PurposeSimplify access to the systemCombine different interfaces
Changes the interfaceNoYes
ApplicationFor your own subsystemsFor external or legacy modules
ResultSimplicityCompatibility

Summary: Facade is about simplifying interaction, Adapter is about compatibility between different interfaces.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.