开发者

Best way to expose service on MVC3

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 se开发者_C百科rvice on a MVC application?

Thanks


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜