1

Well, seems I've made the wrong question on this and will try again in a different way since nobody got interested on helping me. Found few ways to expose methods on a MVC3 application:

  • Add Service.svc file and code there - Works the standard WebService way;
  • Expose methods by routing like this - Service not discoverable;
  • Expose methods using Annotations ([HttpGet], [HttpPost], [HttpPut], [HttpDelete]) - Not discoverable also;
  • Web Api - Works OK, but I'm not sure I need an "API" since the consumer will be an Windows Form Application written by me;

I don't think I need to move my DAL to WCF like this guy. I just need a single input Web Service to feed the application from an automated process.

Oh, and this question has an interesting point of view too.

Again, to be short, what is the best/latest/recommended way to have an input service on a MVC application?

Thanks

Community
  • 1
  • 1
programad
  • 1,291
  • 3
  • 19
  • 38
  • 1
    My guess would be a web service, especially that you are exposing that for another win aplication written by you, im not sure tho what is the trend right now ;). Just go with one most handy for you i would say. – mike Oct 14 '11 at 12:06
  • 1
    I'd think the best way is the one that works best for your situation, no? – asawyer Oct 14 '11 at 12:06

1 Answers1

1

I don't think you should move the DAL into the WCF. WCF Service Layer could be a way to expose a subset of Business Logic to the MVC application, you expose only what is needed and you only expose BL not DAL directly.

This to keep very well separated the DAL technology and details (aka EF, NH, LINQ...) from the other layers BL and Service Layer inclided.

See my answer here: MVC3 and Entity Framework I explained how I imagine to layer a MVC application isolating layers and not exposing DAL details to anybody, not even BL or Service Layer.

Community
  • 1
  • 1
Davide Piras
  • 43,984
  • 10
  • 98
  • 147