O'Reilly logo

Professional ASP.NET 3.5 Security, Membership, and Role Management with C# and VB by Stefan Schackow, Bilal Haidar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

10.2. Patterns Found in the Provider Model

If you have architected a fair number of applications, you invariably have come across design patterns, both theoretical ones that you considered when writing an application and the actual design patterns that you adopted in your application. The provider model in the .NET Framework is no different, with various pieces of the provider development stack mapping to well-known design patterns.

For the classic guide to design patterns, pick up a copy of "Design Patterns: Elements of Reusable Object-Oriented Software" by the Gang of Four: Eric Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Addison-Wesley ISBN: 0-201-63361-2.

The provider-based features in both ASP.NET 2.0 and ASP.NET 3.5 are implementations of the following well-known design patterns:

  • Strategy

  • Factory Method

  • Singleton

  • Façade

Of the four common design patterns, the Strategy pattern is the core design concept that really makes the provider model so powerful.

10.2.1. The Strategy Pattern

In a nutshell, the Strategy design pattern is a design approach that encapsulates important pieces of a feature's functionality in a manner that allows the functionality to be swapped out with different implementations. A Strategy design approach allows a feature to define a public-facing definition of common functionality, while abstracting away the nitty-gritty of the implementation details that underlie the common functionality.

If you were to design your own feature using the Strategy ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required