Posted on Tuesday April 14, 2009

C# Design Patterns: the Façade pattern

Summary

Access multiple classes in one simple to use class. This class is often static too.

Example

A common use of the Façade pattern is with data access managers, a façade class that contains only static methods for CRUD operations. Another example might be a class that handles payment in an online store. This façade class would link into multiple payment providers (paypal, visa/mastercard) as well as updating any order details in a database table. Rather than making the UI perform 10-20 lines of code, this could be done in a simple CheckoutManager.ProcessPayment(…) method.