且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

混合角和ASP.NET MVC /网页API?

更新时间:2022-11-23 12:36:35

纯Web API

我曾经是pretty铁杆的ASP.NET MVC但因为我见过角我不明白为什么我会使用的任何的服务器端内容生成框架的一个原因。纯角/ REST(的WebAPI)给出了一个更丰富,更平滑的结果。它的速度更快,让你建立网站来相当接近桌面应用程序,无需任何时髦的黑客。

I used to be pretty hardcore with ASP.NET MVC but since I've met Angular I do not see one reason why I would use any server side content generation framework. Pure Angular/REST(WebApi) gives a richer and smoother result. It's much faster and allows you to build websites that come quite close to desktop applications, without any funky hacks.

角确实有一点点的学习曲线,但一旦你的团队已经掌握了它,你会在较短的时间打造更好的网站。这主要是必须做的事实,你没有这些状态(少)的问题了。

Angular does have a little learning curve, but once your team has mastered it, you'll build much better websites in less time. Mainly this has to do with the fact that you don't have all these state(less) issues anymore.

例如想象的向导形式的与任何传统的服务器端框架。每个页面都需要进行验证,并单独提交。也许页面的内容依赖于从一个previous页的值。也许用户pressed后退按钮,并重新提交previous形式。我们在哪里存储客户端的状态?采用了棱角分明休息时所有这些并发症是不存在的。

For example imagine a wizard form with any traditional server side framework. Each page needs to be validated and submitted separately. Maybe the content of the page is dependent on values from a previous page. Maybe the user pressed the back button and is re-submitting an previous form. Where do we store the state of the client? All these complications do not exist when using Angular and REST.

所以...过来黑暗的一面......我们已经得到了饼干。

So ... come over to the dark side ... we've got cookies.

Similar问题