Rails框架在Web开发中的研究与应用

论文标题:Rails框架在Web开发中的研究与应用
The Research and Application of Rails Framework in Web Development
随着Web应用的日益广泛和Web开发技术的不断发展,开发者迫切需要一种能够简化开发过程,降低开发难度,提高开发效率的框架。目前在Web开发平台中人们使用最多的是J2EE。但随着需求的多样化,不断加入的各种组件和逐渐膨胀的XML配置管理文件使得J2EE应用体系变得臃肿不堪,在开发和运行速度上越来越不能满足开发者的需求。 2004年丹麦程序员David在37signals公司支持下开发了Ruby on Rails(简称Rails)框架。该框架与J2EE相比在迅速开发和部署Web应用方面体现了强大的优势。Rails框架自身包含构建Web应用的完整组件,不需要与其它框架整合就能高效开发应用程序,从而使开发变得简单而快捷,极大的满足了开发者的需求。 本文对Rails框架做了深入的探索和实践,主要工作集中在如下几个方面; 1.研究了Rails框架的各种特性、核心体系结构以及关键技术,并分层讨论了Rails的开发优势。 2.应用Rails框架实现了一个在线购物系统—SS_yuansu,并在该系统的具体实现过程中验证了Rails在开发Web应用的简单与快捷。 3.本文通过保证信息在数据库与浏览器之间双向传输的正确性,成功解决了在Rails框架下开发Web应用不支持中文显示的问题。 4.在Rails框架中,如果利用XML进行数据传输,必须有API的支持并且需要进行双向解析,影响数据传输效率。因此,本文采用JSON来取代XML进行数据传输,不仅显著地减少了代码编写量,而且可大大提高数据的传输效率。 本文对Rails框架下进行Web开发技术作了深入研究与探索,并具体构建了一个在线购物系统。在构建该系统的过程中,针对Rails框架下不支持中文显示问题和数据传输效率低等问题给出了相应的解决方案。这些技术上的改进在一定程度上优化了Rails框架,对于促进该框架在我国的推广和应用具有一定的实际意义。
With the spread of Web application and the development of Web technology, developers urgently require a kind of Web Development Framework which can simplify development course, make development more convenient and improve development efficiency. J2EE is a popular Web Development Platform used by developers at the present time. With the diversification of developers" demands, more and more components have been added to J2EE, and XML configuration management files have become enlarged. All of these make J2EE overstaffed, which affects software development cycle and application running speed. So nowadays J2EE can not meet the needs of developers completely. Ruby on Rails Web Development Framework was developed by Danish programmer David supported by 37signals company in 2004. Compared with J2EE, Rails Framework has great advantages in development speed and deploying Web application. Rails encompasses the whole components for constructing web application, so developers could develop web applications without integrating other frameworks into Rails. It makes web development more convenient and efficient. In this paper, Rails framework was studied thoroughly, and some practices with Rails framework were done accordingly. This paper focused on the follows: Characteristics and core architecture of Rails were studied in detail and key technology of Rails was explored deeply. Moreover, advantages of Rails had been elaborated layer by layer. An on-line shopping system named SS_yuansu was developed in Rails, and during the course of development, the convenience and efficiency of Rails was validated. Through ensuring validity of information transmitted between databases and web browsers, the problem that Web applications developed with Rails could not display Chinese was solved successively. During this SS_yuansu application"s development in Rails framework, the problem that if XML was used for data transmission, it had to be supported by API and two-way analysis was inevitable, and data transmission efficiency would be affected subsequently was encountered. So XML was replaced with JSON during the course of development, through this way, the amount of code was reduced dramatically, and data transmission efficiency was enhanced simultaneously. This paper explored the technology of Web application development in Rails framework thoroughly, and an on-line shopping system was constructed with Rails in this paper. In the course of the system"s development, this paper put forward the solutions to the problems that Web applications developed with Rails could not display Chinese and that using XML for data transmission in Rails would decrease efficiency. These innovations optimized Rails framework in some extent and have great significance in promoting the spread and utilization of Rails in China.

你可能感兴趣的:(框架,Web,json,Ruby,Rails)