When to use ASP.NET MVC to build out REST-ful services and when to use WCF
A common question that comes up is when to use ASP.NET MVC to build out REST-ful services and when to use WCF?
when the only reason for the service’s existence is to service the one application you’re currently building, it may make more sense would stick with the simple case of using ASP.NET MVC. This is commonly the case when the only client to your JSON service is your web application’s Ajax code.
When your service is intended to serve multiple clients (not just your one application) or hit large scale usage, then moving to a real services layer such as WCF may be more appropriate.
RESTful Services with ASP.NET MVC and XHTML
There are several reasons to consider using XHTML as the default representation for your ASP.NET MVC RESTful services. First, you can leverage the syntax and semantics for important elements like <a>, <form>, and <input> instead of inventing your own. Second, you’ll end up with services that feel a lot like sites because they’ll be browsable by both users and applications. The XHTML is still interpreted by a human—it’s just a programmer during development instead of a user at runtime. This simplifies things throughout the development process and makes it easier for consumers to learn how your service works. And finally, you can leverage standard Web development frameworks to build your RESTful services.
ASP.NET MVC is one such framework that provides an inherently RESTful model for building XHTML-based services. This article walks through some XHTML design concepts and then shows you how to build a complete XHTML-based RESTful service.
Contents
XHTML: Representing Data and Links
XHTML: Representing Input with Forms
Understanding the ASP.NET MVC Architecture
Implementing the Model
Implementing the Controller
Designing URIs with Routes
Implementing the Views
Consuming the Bookmark Service
Acknowledgments
MVC Membership Starter Kit Released
What is the Asp.Net MVC Membership Starter Kit?
The starter kit currently consists of two things:
- A sample website containing the controllers, models, and views needed to administer users & roles.
- A library that provides testable interfaces for administering users & roles and concrete implementations of those interfaces that wrap the built-in Asp.Net Membership & Roles providers.
ASP.NET MVC V2 Preview 1 Released – ScottGu’s Blog
The ASP.NET team just released the first public preview of ASP.NET MVC Version 2. You can download it here.
New features:
Areas Support
DataAnnotation Validation Support
Strongly Typed UI Helpers
UI Helper Templating Support
- New [HttpPost] Attribute
- Default Parameter Values
- Binding Binary Data
Upgrading the default ASP.NET MVC project with IoC and the Unity Controller Factory
The first part is easy, just grab the Unity DLLs and reference them in your MVC project. At this point, you’re now free to use Unity to inject whatever you feel like. Rigging up the controller factory so that it will use Unity to resolve controllers is equally easy because the mvc contrib codeplex site has already created a class called UnityControllerFactory that does just this. Once you’ve added references to Unity and Mvc.Contrib.Unity from your MVC project, you can change your global.asax.cs file to look something like this:
if (_container == null)
{
_container = new UnityContainer();
ControllerBuilder.Current.SetControllerFactory(typeof(UnityControllerFactory));
_container.RegisterType(typeof(HomeController), typeof(HomeController));
_container.RegisterInstance(typeof(AccountController), new AccountController());
}
ASP.NET MVC T4 Template: Routing, Forms, DI container, fixes
Via Angle Bracket Percent : T4MVC 2.2 update: Routing, Forms, DI container, fixes
ASP.NET MVC Installer For Visual Studio 2010 Beta 1 Released
The installer is now available on CodePlex. Be sure to give it a try as many of the new VS10 features intended to support the TDD workflow fit very nicely with ASP.NET MVC. You can also check out how to create a new Controller the TDD way here.
ASP.NET MVC Installer For Visual Studio 2010 Beta 1 And Roadmap
NUnit Templates for ASP.Net MVC 1.0 RTM
Update: a new version support MVC 2.0
To install the templates, just extract the zip file from the link below and run installNUnit.cmd. If you are installing on Vista or higher, run the cmd file as an admin.
Download -> NUnit Test Templates
Via Visual Web Developer Team Blog : Updated NUnit Templates for ASP.Net MVC 1.0 RTM
25+ Best ASP.NET MVC Tutorials and Articles
Learn ASP.NET MVC
Script and CSS Management in ASP.NET MVC
Free ASP.NET MVC NerdDinner Tutorial Now in HTML
Upgrading the default ASP.NET MVC project with IoC and the Unity Controller Factory
Integrating Silverlight and ASP.NET MVC
Walkthrough: full example of using MvcContrib grid with jQuery datatable
Modifying the default unit tests for an ASP.NET MVC project to use Moq
Using jQuery Grid With ASP.NET MVC
Asp.Net MVC + jQuery == true
+ More… Via 25+ Best ASP.NET MVC Tutorials and Articles | AjaxLine
Free ASP.NET MVC eBook Tutorial – ScottGu’s Blog
A 185 page end-to-end tutorial that walks-through building a small, but complete, ASP.NET MVC application from scratch.
Download Links
- Download the free end-to-end tutorial chapter in PDF form
- Download the source code + unit tests for the completed application
- Learn more about the book from the official Wrox page
- Purchase the full book from Amazon.
![bookcover[1] bookcover[1]](http://weblogs.asp.net/blogs/scottgu/bookcover1_6CAECF94.png)
