At the moment ServiceAgentFactory.GetAgent contains a huge switch iterating through a large number of agents. But the agents could be specified in the model and the switch could be dropped.
Removing the switch is not a straigh forward process. I tried moving the class paths to the model and deleting everyting except for the default case. This resulted in a problem in the ConnectRuntime method:
The GetAgent method from the ServiceAgentFactory is called in the InitializeServices method. And fails with NullReferenceException.
It looks like moving the InitializeSchemaItemProviders before the InitializeServices method might help but it does not. InitializeSchemaItemProviders depends on some services…
So i moved the services outside of the InitializeServices method. That helped but then another exception wast encountered.