What is an ASP.NET Provider?

2019-04-29 04:26发布

问题:

What is the meaning of "Provider" in ASP.NET Provider? For example when we are speaking about AuthorizationRuleProvider, connectionStrings.providerName, ...?

回答1:

It's a design pattern: The Provider model. There is some good information in this SO Q&A as well: Designing loosely coupled components in .NET - Provider Pattern



回答2:

It's just a concrete implementation of an abstract interface. You can select an appropriate provider to fulfill the requirements of the interface at runtime.



回答3:

And if you want to implement the Provider pattern in your application, take a look at this .NET Provider Model Template for Visual Studio (shameless plug).