Facade

Summary

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

Example

A common use of the Facade pattern is with data access managers, a facade class that contains only static methods for CRUD operations. Another example might be a class that handles payment in an online store. This fascade 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. The minor setback of this of course is handling return codes.

TODO Example

Last updated on 02 February 2009

Comments

blog comments powered by Disqus