I have 2 projects
-
App (WindosForms used only as UI for starting components )
-
Components
Components has all interfaces and default implementation that I inject through StructureMap (Registry).
In this project i introduce a interface for Logging and default implementation for all classes (Log2Cnsole) and register with StructureMap.
What i need is that if some one wants to use his own UI app and remove default one I want that user of component DLL can override the default Log2Console with his, only if hi implement his (example LogToDB override Log2Console if he implement interface in his own project and register through StructureMap).
Sorry for my bad English.
The way to do this is offer a default constructor that calls another constructor with a specific implementation: