Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Facade Pattern

Intent

Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.

Problem

A complex subsystem has many interdependent classes with complicated interfaces, making it difficult for clients to use.

Solution

The Facade pattern provides a simplified interface to a complex subsystem, making it easier to use while still allowing access to the full functionality when needed.

When to Use

  • You want to provide a simple interface to a complex subsystem
  • There are many dependencies between clients and implementation classes
  • You want to layer your subsystems

C# Implementation

See the Program.cs file for a home theater facade simplifying complex subsystem interactions.

Pros

  • Isolates clients from subsystem components
  • Promotes weak coupling between subsystems and clients
  • Simplifies the interface for common use cases

Cons

  • A facade can become a god object coupled to all classes of an app
  • May become too complex if not designed carefully