weixin_33675507 2012-05-08 18:57 采纳率: 0%
浏览 32

WebService作为演示者

I'm working on a ASP.NET Web Application and I want to create clear architecture using MVP. Because of the application type there are AJAX requests from the View to the back-end of the website. I'm wondering will it be legal MVP if I'm making AJAX requests to a WebService (which will act like a Presenter) which will control the business logic using the Models and return the result as serialized data to the View?

Thanks in advance!

  • 写回答

2条回答 默认 最新

  • weixin_33695450 2012-05-08 19:14
    关注

    There is nothing illegal in calling a web service with help of AJAX from your web page. However, I'm not sure what prevents you from designing a clear MVP architecture with help of classic ASP.NET WebForms application? You can build the very light-weight Views (having client-side JavaScript / html code only, for example) and have a Presenter class(s) for your View(s).

    My opinion is: I will try to avoid designing and hosting web services for serving a web page unless this is the only possible approach. The problems may occur when it comes for deployment and configuration of your application. Consider the authentication as well, etc... Another problem is: how to split your functionality into services and how many services do you need.

    评论

报告相同问题?