The CEF Provider System adds the capability to have “drop-in” assemblies
(plugins) that augment or override core back-end functionality. Provider
Plugins can be used for third-party integrations (shipping providers
[UPS, FedEx, …], payment providers [PayPal, Authorize, …]),
swappable core implementations (ex. FlatPriceProvider,
TieredPriceProvider), or client-specific implementations (ex.
AbasPriceProvider, GoAfricaMembershipProvider).
Each provider has its own Visual Studio project. The projects should be
located in the Providers folder of the CEF solution within a folder
matching the provider type.
Providers are organized by type where all providers of the same type
implement the provider type interface (ex. Price Providers implement
IPriceProvider). All providers also implement IProvider.
Provider Types
Providers are made available within CEF through the use of type specific
Provider Factories. A Provider Factory has a GetProvider method that
will retrieve a provider from the available providers in the current
environment based on specification or configuration.
The static ProviderFactoryCollection is responsible for instantiating a
collection of all providers found in the configured
Providers.PluginPaths which is by default the \Plugins folder off the
CEF root. For a plugin to be available it must be in the plugins folder
and it also must be enabled.
PluginPath
Sets the path where the provider plugins (assemblies) should be found.
The {CEF_RootPath} can be used to inject the CEF root from the current
environment. Typically this value does not need to change.
<add key="SystemValues.Providers.PluginPaths" value="{CEF_RootPath}Plugins" />
EnabledPlugins
Sets the plugins that should be enabled. Value is a comma delimited list
of provider names. The special value of “*ALL*” can be used to
enable all providers (ideal for testing project configurations). Only
plugins that are in the plugin folder and enabled will be instantiated
by the ProviderFactoryCollection. This setting allows for quick changes
to what Providers are loaded without the need to add or remove
assemblies from the plugins folder.
<add key="SystemValues.Providers.EnabledProviders" value="FlatPriceProvider,AvalaraAddressProvider" />
Each provider type can have a configuration value that can specify the
default provider for that type. This is needed for instances where
multiple providers may be enabled but one needs to set as the default.
The actual need for and use of these configuration values is based on
the Provider Factory for the specified Provider Type.
<add key="SystemValues.Providers.PriceProvider" value="TieredPriceProvider" />
<add key="SystemValues.Providers.AddressProvider" value="MockAddressProvider" />
<File:Providers_Loader_Flow.PNG%7CDefault> Provider loading flow|alt=alt
language <File:Class_Diagram.PNG%7CDefault> Provider class
diagram|alt=alt language