Improving ProviderFactory The ProviderFactory is a light weight component for mapping (I)nterfaces to Class implementations through standard app/web config files. The goal is to create a re-usable factory the is flexible and easy to understand and implement. If you are looking for a more feature-rich environment, then we suggest looking at Castle, Spring.net or PnP IoC projects.
Improving ProviderFactory: - promotes better software design through simple component decoupling and easy to configure factory pattern/provider model implementations
- property injection to easily wire up needed config values (for example "connection string")
- .NET generics to return specific type without casting return type
- custom Config section to map Interface to Class/Assemblies
- to change your Interface implementation: update Config and deploy assembly to /bin/ folder. No need to recompile or reference new assembly.
To Use:
- Reference Improving ProviderFactory from your code.
- Add config information to your project (from sample)
- Add project interfaces and assembly/class mappings to config file. (Feel free to use development mock-ups - you can always change out the implementation later!)
- Develop your application
- update config values, test your code
- Serve hot and enjoy!