It´s important to note that this would not break the previously supported contract for the other teams.
Two methods of initialization would be possible:
Passing an ICodeProcessor.
Passing an ICodeProcesorProduct and a collection of ICodeProcessorWorker.
The first method would reuse the second, as it would be possible to split the ICodeProcessor reference into two (one for ICodeProcessorProduct and another to ICodeProcessorWorker).
Pseudocode for deciding when to run each worker
codeDescriptor = main.GetCodeDescriptor();
foreach worker in Workers
{
if (worker.SupportedExtensions.Where(e => e.IsEntryPointExtension).Any(e => codeDescriptor.FoundExtensions.Contains(e)))
{
worker.Execute();
}
}
Work items
Option #2: The Controller handles a single composite code processor
Pros:
The Controller would remain mostly unaffected.
Cons :
We might need to introduce a complex mechanism for assigning CodeModelWriters, Loggers, etc that the composite code processor would need to respect.