Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,

I need to implement some services whit the only limitation that has to be json.

Many of the foruns, blogs, discussions and final decisions turns to be around particular cases and restrictions. For this especific implementation the flew restricitons are:
DB is MS SQL
Language is C#
Client and Server are in the same infraestructure (no communication/authentication tricks needed)
I will use Visual Studio for convenience.

So according to your experience what i should use?
WCF?
MVC?
Web API?
Others ...?

There are amazing articles with the diferent methods, like this:
JSON and Microsoft technologies[^]
But i dont know why should i pick one option over another:

Thanks,
Rui Silva
Posted

If you don't need authentication, complex security, complex message types etc, and your calls are just going over http or https then WebAPI is probably your best bet. It's lighter and simpler than the likes of WCF. WCF gives you a lot more features, but it's harder to configure and if you're not using those features there is no point getting your head around WCF config when you don't need to.

The other thing you need to think about is what is hosting your service...WCF and WebAPI can both be hosted in a normal asp.net site, or in their own processes, but it's something you'll need to consider. Again for simplicity if you're going for WebAPI then hosting in IIS will be the simplest way.
 
Share this answer
 
At this moment, the question does not makes sense at all. Do you understand the principles "separation of concerns" and "divide and conquer"? Also, you simply need to avoid artificial (accidental) coupling of unrelated things. The choice between architectural patterns or ASP.NET frameworks have nothing to do with the choice of JSON tools or libraries. Decide separately on those issues, that's the solution. But perhaps this is a solution to the problem which does not exist, because you did not really formulate any, so it could be just all in your head.

Please see:
https://en.wikipedia.org/wiki/Separation_of_concerns[^],
https://en.wikipedia.org/wiki/Divide_and_conquer[^],
https://en.wikipedia.org/wiki/Abstraction_principle_%28computer_programming%29[^],
https://en.wikipedia.org/wiki/Coupling_%28computer_programming%29[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900