ASP.NET MVC - 一次思想解放

本文深入探讨了ASP.NET MVC框架结合REST架构的应用方式,并强调了这种架构如何改变传统Web应用的设计理念,从页面到资源的转变,以及远程过程调用的概念。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

如果你看过ScottGu的MVC系列blog,那么你一定对MVC有了一个初步的认识。这只是惊鸿一瞥!

Rob Conery带来的才是真正的 ”思想解放“!(用词太夸张了吧?- 看过Rob的blog 就知道了)

必读 - http://blog.wekeroad.com/2007/12/06/aspnet-mvc-using-restful-architecture/

思想解放1 - REST是什么

People like to equate REST and SOAP in the same sentence, as if it’s an option for web service architecture. The truth is, REST is an architectural principle in and of itself that is as old as the web and, In fact, the Web itself is the REST poster child. More accurately: REST is a state of mind.

思想解放2.1 - 没有"Pages"只有"Remote Procedure Calls"

you should throw the notion of “pages” away, since these “resources” should be consumable by whatever client is calling on them (so the information might be an XML or JSON stream). To summarize: stop thinking “pages”, start thinking “Remote Procedure Call”.

思想解放2.2 - 没有"Form"

The important thing to remember at all times is that  you are building an instruction set for the web - a collection of consumable “Methods” that are displayed via “Views”.

思想解放3 - 没有"Site"

it’s not a collection of pages. It’s an application and as such, the logic can be plugged into other MVC applications.

If you move this to a new MVC Application, or combine it with another, you just reset some routes in your Global.asax and drop in your Views (these are static content pages) - and you’re all set!


 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值