Hi,
in my project, I would like to separate the code into three different assemblies:
1.) The frontend
2.) The backend
3.) The backend's interface
Basically, the backend will implement all the interfaces that are defined by the backend's interface. Now the frontend should only know about the backend's interface, not the backend itself.
Thus both, the frontend and the backend should have a reference to the backend's interface. But they should not know each other.
Now I need a ServiceLocator that provides the frontend with implementations of the backend's interface.
Something like
DoSomethingService dss = ServiceLocator.GetService<DoSomethingService>();
But how does the ServiceLocator get the information about the implementations?
The easy way would be to put it into the backend, but then the frontend would have a dependency there, which I don't want to have.
Defining the interface and implementation via XML and using "Type.GetType(string)" in the ServiceFactory does not work either, since I need a reference to the type's implementation when trying to create the type from the string.
What other options do I have?
The application is an ASP.NET-Application with xcopy-deployment and two assemblies used: The backend and the backend's interface.
Do you have any other ideas, how I can implement this?