The reason I need a loosely coupled WCF is because the Entity Framework is tightly coupled. When I say “loosely coupled”, there is no need to instantiate the database context or add a link to the WCF service. It simply relies on a web configuration or some kind of .ini file that does not require compilation when developers need to change servers, the IP address or the service URL.
Instead, the MVC (say, the controller) will simply send a request message and then receive the response data from the WCF service. But still we cannot afford, without having database-based models (since we need it in intellisense for marking up views), where the WCF will receive the data. Say we already have a class of database objects, create some repository that links WCF data to MVC models.
What I mean for the WCF web service is that it ONLY contains messages, no more passing an object reference, because this is a new SOA definition. It makes sense to pass messages instead of objects.
Is this a better approach? As for scalability and performance, I don't want to offend Entity Framework fans.
source share