Choosing a REST framework for using alongside asp.net-mvc
I already have my site built using asp.net mvc, which basically talks to my service layer. The service layer is designed so that outside applications can call into it as an API (probably similar to twitter).
Think of it as an exact twitter rip off. Features used:
- Authentication(password, facebook, twitter, OpenID).
- CRUD on data.
Now my problem is selecting a RESTful API framework. I was thinking about the following:
- If I use asp.net mvc, will I be restricted in anyw开发者_StackOverflow中文版ay? For eg, page lifecycle, etc.
- I'm trying to keep away from WCF as I've heard its too large and bulky.
- How well would ADO.NET data services mesh with my app design?
- What about OpenRasta?
I think I designed both my service layer and the mvc app(sessions, etc) to scale horizontally so far. Not sure what is needed for the API to scale.
I know you mentioned wanting to stay away from WCF (proper) and I can understand that.
Depending on your requirements (is this a mission critical site? for profit?) might I suggest at least looking at the WCF Web API. This isn't a finalized release as a new preview build was just dropped at Mix 11 so if your requirements dictate something more PROD ready then I'd steer you towards what jdangelo mentioned. Otherwise, I've found the web api to be pretty enjoyable.
For a good overview and example of what the framework offers take a look at Alex Zeitler's walkthrough.
There are also NuGet packages available (search WebApi) with samples to further expose you to what can be done.
精彩评论