I'm working on a larger project. I hope I understood DI well and based-on that I'm able to do this:
// domain object holding configuration ata
var input = new GeneratorInput
{
Constructions = new List<Construction>(),
InitialConfiguration = null,
MaximalNumberOfIterations = 10
};
// poor-man's-DI solution
var container = new ConfigurationContainer(input.InitialConfiguration);
var constructions = new ConfigurationConstructor(input.Constructions);
var solver = new ConfigurationSolver();
var handler = new ConfigurationHandler(container, constructions, solver);
var generatorContext = new GeneratorContext(container, handler, constructions);
var generator = new Generator(generatorContext, input.MaximalNumberOfIterations);
The GeneratorInput should be created based on UI parameters.
I can't figure out a way to do this via a DI container. I think I want to use NInject.
What is the cleaneast way of doing this please?