Export (0) Print
Expand All

Providers

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

A provider in the .NET Framework is an intermediary piece of code; with it, your application can connect to a service or data source and then retrieve or modify an object or data from that service or source. The Enterprise Library includes many providers. In addition, you can create your own provider to supply information that you need for your specific application.

A provider type defines an interface that is associated with a capability an application block must have to perform correctly. A provider is a specific implementation of a provider type. Each application block includes one or more providers for each provider type. You can also write custom providers for application blocks. Separating the application block's functionality from specific implementations of its capabilities achieves the following goals:

  • Variability. With this, you can choose from multiple implementations of the same capability, according to the requirements of a specific application.
  • Extensibility. With this, you can use the application block in environments where the capability in question has a mandatory implementation. For example, an application can require a specific encryption algorithm when deployed to a particular environment.
  • Encapsulation. With this, you can react to changes in the environment in which the application block is used. With providers, functionality that is not a part of the application block's core functionality can be replaced or upgraded without affecting other areas of the application block.
  • Portability across environments. With this, you can deploy the application block in a new environment with providers specific to that environment. You can also create providers that run in one environment and simulate behavior from a different environment.
  • Minimized coupling between application blocks. Application blocks that are dependent on other application blocks can encapsulate this dependency in a provider. This means that the application block is less vulnerable to revisions in the application block on which it depends. For example, the Exception Handling Application Block includes the logging exception handler. This handler is dependent on the Logging Application Block and is included as a provider. A new version of the Logging Application Block would require only a new logging handler provider; the rest of the Exception Handling Application Block can remain unchanged.

For information about creating your own providers, see Adding Application Code.

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.
Show:
© 2014 Microsoft