Skip to main content
4 of 13
added 538 characters in body
Kyle
  • 2.8k
  • 18
  • 24

As far as writing one application that leverages both ASP.NET and WCF, it works OK, but not great. In one project I am familiar with, they ended up with two different sets of models, one for the WCF code and one for the MVC code. WCF request and response objects should be annotated with [DataContract] and their properties with [DataMember], while MVC does not require this. Idiomatic MVC on the other hand is going to want ViewModels, which have different goals than WCF DataContracts. Of course, its possible that the use of two full sets of domain objects had more to do with Conway's law than WCF & MVC conflicting, but it's worth pointing out that WCF and MVC have different goals and requirements as far as output and input.

Personally, I'm partial to developing a simple but powerful services oriented back end API, particularly when you might want multiple clients. I think the advent of excellent JavaScript MVVM and micro- MVC frameworks makes this a natural choice, as writing application code using BackboneJS, KnockoutJS and others allows for a capable development environment.

Suggestion

Either WebAPI or Service Stack might be good candidates for building your back end API. I recommend Service Stack, as I've been using it for the last few months and have found it to be an excellent replacement to WCF. I'm currently writing a tutorial series on service stack on my blog.

The group maintaining service stack has posted an example application using the framework to develop a StackOverflow like clone which shows a development pattern that I believe is especially compelling. Coincidentally, Stack Exchange hired the original Service Stack author. He continues to commit actively to the Service Stack project.

Kyle
  • 2.8k
  • 18
  • 24