Hi I have worked for a couple companies now. Both used MVC to create their software. One company used WCF Services for all of their Ajax Calls while my most recent company is making all of their Ajax calls to their Controllers. I prefer the WCF method as it seems to keep the code cleaner and more readable, however, according to MVC all view calls should go through a controller. I was just wondering if anyone had any good information, references, or articles as to which is better practice, or if it's better to make service calls to a controller or WCF service? Thanks
1 Answer
It looks both approaches will work fine. But, WCF is more appropriate solution if you want to have something like Service Layer inside of your solution. But for Ajax calls from the Web part to Controller work okay.
2 Comments
Lizzard
Are there any performance gains in using one over other? If you have an MVC app is there any point to ever creating a WCF if you never need a 3rd party to access it? Doesn't using the controller muddle the controller itself?
paramosh
I don't think that there is some notable differences in performance. But WCF has other advantages, you can read here msdn.microsoft.com/en-us/library/ee658090.aspx