Understand the Dynamic Implementation Sample
mainThis sample demonstrates how to build a pluggable application where adding new modules can extend or alter existing behavior using a dependency injection container. It showcases how to coordinate shared types between a host and multiple plugins.
Project Structure:
- Host: A console application that serves as the entry point and contains the sample execution logic.
- Contracts: A project containing the interfaces shared by both the host and the plugins to ensure type compatibility.
- Mixer: A plugin providing the default implementation. It includes
FruitService(returning 3 fruits) and aMixerservice (returning a fruit shake). - ServiceImplementation: An alternative plugin. When included in the plugin set, it overrides the default
FruitServicebehavior, causing the shake to be composed of only a Banana.