摘要
作为Web应用技术的探索与实践,提出了面向资源的RESTful Web应用设计思路。通过对Rails框架下RESTful Web的实现原理进行分析,从资源的规划、控制器的设计、模型的建立、表间关联以及RESTful URI的设计等方面对RESTful Web应用进行了研究,给出了Rails框架下RESTful Web应用的开发步骤。最后,通过一个实例实现了面向资源的RESTful Web应用。这种基于资源的设计将所有功能转化为资源,完全打破了传统的基于动作的设计思路,同时说明了REST思想从Web服务到Web应用是可行的。
To explore and practise the technologies of Web applications,the idea of resource-oriented RESTful Web application is proposed. After analyzing the implementation principles of RESTful Web based on Rails framework,the resource planning,controller design,model build ,relationships between tables,as well as RESTful URI are studied,and then the steps of RESTful Web application development on Rails are provided. Finally,an example of resource-oriented RESTful Web application is implemented. This resource-based design transforms all functions into resources,completely breaks the traditional action-based design ideas,and the example shows that the REST ideas from the Web services to Web applications is feasible.
出处
《微计算机应用》
2010年第7期38-43,共6页
Microcomputer Applications
关键词
面向资源
RAILS框架
表述性状态迁移
WEB应用
Resource-oriented
Rails framework
REpresentational State Transfer(REST)
Web application