What is a decent way to handle conditional windings with a DI approach. A script is a loader object that is entered into an entry, depending on the settings of that entry. I originally introduced the IoC container in the factory and used it for resolution based on naming conventions. However, I really would like to keep the factory clean in the container.
factory is introduced into a class that will load all settings from the database, and then use factory to create a set of records. Settings determine which bootloader will be used inside this record.
Edit: change the code to better highlight the actual issue. The problem is that multiple database managers must be supported at the same time, if it is not, then it will be simple. The type of database manager is determined by the record parameters stored for a particular record.
public class Entry : IEntry { private ISomething loader; public Entry(ISomething something) { this.loader = something; } } public class EntryFactory : IEntryFactory { IEntry BuildEntry(IEntrySetting setting) {
I believed that the register of subfiles is registered in the main factory and resolves them that way, but I don't know if there is a better approach.
source share