Top

Tags


Roadkill .NET Wiki

Google ads

Recommended reading


Search

Tuesday
Apr142009

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 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.

A working example of a set of facade classes can be found in the Roadkill Managers folder.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
« Your base class: Abstract or Interface? | Main | Image conversion in C# »