Avoiding Dependencies(stevesmithblog.com)
submitted by
ssmith(1160) 3 years, 8 months ago
As a rule, code should not directly depend on external resources such as System.Net.Mail's email sending capabilities. Having code that directly calls out to System.Net.Mail is difficult to unit test as well as difficult to walk through in a test or stage environment without having actual emails sent. Two design patterns can be used to reduce this dependency: Facade and Strategy. The Strategy pattern offers a host of benefits above and beyond what the facade layer provides, as this articles demonstrates with code examples.
|category: C#
|Views: 558
tags:
fff C# another
Everyones tags:
Your Tags: