Service Agent Factory - Hardcoded Agents

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.

Is there a reason why it is done this way?

Currently not. It became like this in an iterative way and the time came when we could just push the class names from the code to the model.

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.

This time in OrigamXmlManager.

This seems to be more complicated than originally thought so I shelved this task.

Cannot we move at least some of them? I guess we only have a problem with somethimg like DataService.