ruby-on-rails_Ruby on Rails-程序员宅基地

技术标签: spring  python  java  数据库  大数据  

ruby-on-rails

Ruby on Rails (Ruby on Rails)

Ruby on Rails is a free framework that promises to increase speed and ease in website development-oriented database (database-driven web sites), since it is possible to create applications based on predefined structures. Often referred to as Rails or RoR, Ruby on Rails is an open source project written in Ruby programming language. Applications created using the Rails framework are developed based on the design pattern MVC (Model-View-Controller).

Ruby on Rails是一个免费框架,它有望提高面向网站开发的数据库(数据库驱动的网站)的速度和便利性,因为可以基于预定义的结构创建应用程序。 Ruby on Rails通常被称为Rails或RoR,是一个用Ruby编程语言编写的开源项目。 使用Rails框架创建的应用程序是基于设计模式MVC(模型-视图-控制器)开发的。

Ruby on Rails was extracted from a David Heinemeier Hansson of one of its projects, the project manager Basecamp. It was released to the public for the first time in July 2004.

Ruby on Rails摘自其项目之一David Heinemeier Hansson的项目经理Basecamp。 它于2004年7月首次向公众发布。

Ruby on Rails组件 (Ruby on Rails Components )

Rails is a “meta-framework”, since it is a junction of five frameworks:

Rails是“元框架”,因为它是五个框架的结合:

Active Record

活动记录

Active Record is a layer of mapping object-relational (object-relational mapping layer), responsible for interoperability between application and database and data abstraction.

Active Record是映射对象关系的层(对象关系映射层),负责应用程序与数据库之间的互操作性以及数据抽象。

Action Pack

行动包

Understands the Action View (generation of user viewing as HTML, XML, JavaScript, etc.) and the Action Controller (control the flow of business).

了解操作视图(以HTML,XML,JavaScript等形式生成用户视图)和操作控制器(控制业务流程)。

Action Mailer

动作邮件

The Action Mailer is a framework responsible for the delivery service and even receive e-mails. It is relatively small and simple, but powerful and able to perform various operations with calls only mail delivery.

Action Mailer是负责传递服务甚至接收电子邮件的框架。 它相对较小且简单,但是功能强大并且仅通过邮件传递就可以执行各种操作。

Active Support

积极支持

Active Support is a collection of several useful classes and extensions to standard libraries, which were considered useful for applications in Ruby on Rails.

活动支持是几个有用的类和标准库扩展的集合,这些类和扩展被认为对Ruby on Rails中的应用有用。

Action WebServices

动作Web服务

Provides a way to publish interoperable APIs with Rails without the need to spend time in protocol specifications. Implements WSDL and SOAP.

提供了一种发布与Rails互操作的API的方法,而无需花费时间在协议规范上。 实现WSDL和SOAP。

The Action Web Service is no longer present in version 2.0 on Rails, since that is turning to the use of the REST model. Still, even those interested in using it, you can do so by installing a plugin.

在Rails的2.0版中不再提供Action Web Service,因为这已转向使用REST模型。 尽管如此,即使是有兴趣使用它的人,也可以通过安装插件来实现。

Development Time

开发时间

Ruby on Rails follows two concepts aimed at increasing developer productivity: DRY and Convention over Configuration. These methods are implemented across the rails, but may be more noticeable in “packages” Active Record (ORM, Object Relational Mapper) and Action Pack (MVC)

Ruby on Rails遵循两个旨在提高开发人员生产力的概念:DRY和Convention on Configuration。 这些方法是跨导轨实现的,但在“包” Active Record(ORM,对象关系映射器)和Action Pack(MVC)中可能更引人注意。

DRY

干燥

DRY (Do not Repeat Yourself, Do not repeat yourself) is the concept behind the technique of defining names, properties and codes in one place and reuse this information to others.

DRY(不要重复自己,不要重复自己)是在一个地方定义名称,属性和代码并将此信息重用于其他地方的技术背后的概念。

For example, instead of having a People table and a class Person with a property, a method “accessor (getter) and a” modifier “(setter) for each field in the table, it has been only in the database. Properties and methods needed are “injected” in the class through features of Ruby.

例如,表中的每个字段都没有一个People表和一个具有属性的Person类,而是为表中的每个字段提供了一种方法“ accessor(getter)和a修饰符”(setter),而仅存在于数据库中。 通过Ruby的功能将所需的属性和方法“注入”到类中。

Thus, this saves time, since it is not necessary to change the table, the “bean”, the “form bean”, the “home site”, the “home”, the “session”, … Changing only the database, everything is based on this information is updated automatically.

因此,由于无需更改表,“ bean”,“ form bean”,“ home site”,“ home”,“ session”,……,因此无需更改表,从而节省了时间。基于此信息将自动更新。

Convention over configuration

约定优于配置

In most cases, we use conventions in the day-to-day programming in general to facilitate understanding and maintenance by other developers. Knowing this, and knowing that the time spent to set up frameworks for XML in some other languages is extremely high, it was decided to adopt the concept.

在大多数情况下,我们通常在日常编程中使用约定,以促进其他开发人员的理解和维护。 知道这一点,并且知道花费一些时间来建立其他语言的XML框架之后,便决定采用该概念。

He basically says that one must assume default values where there is a convention. If the developer wants, you can override this convention with the necessary amount. For example, a User class can have their data stored in the Customer table. Following convention, would be in the Users table. Thus, the development time drops further.

他基本上说,在有约定的情况下,必须假定默认值。 如果开发人员需要,可以用必要的数量覆盖此约定。 例如,一个User类可以将其数据存储在Customer表中。 按照约定,将在Users表中。 因此,开发时间进一步减少。

Ruby on Rails –可扩展性 (Ruby on Rails – Scalability )

Most sites do not need sophisticated schemes to scale, just a few accelerators. In smaller sites, or normal, a default web server can handle a good amount of cargo, especially if you use FastCGI, Mongrel or LightTPD, which are necessary to obtain an acceptable speed of opening the page. Comparing an application with FastCGI and FastCGI without (running straight as Ruby CGI), the difference is noticeable in any application. The processing of the code (not counting download time) CGI occurs in at least 10 seconds even on servers Quad Core, while in FastCGI performance is remarkable: in a maximum of 1 second page is processed, such as which web languages PHP.

大多数站点不需要复杂的方案即可扩展,仅需几个加速器即可。 在较小的站点或正常的站点中,默认的Web服务器可以处理大量的货物,尤其是如果您使用FastCGI,Mongrel或LightTPD,这对于获得可接受的打开页面速度是必需的。 将应用程序与不带FastCGI和FastCGI的应用程序进行比较(直接运行为Ruby CGI),在任何应用程序中差异都非常明显。 即使在服务器Quad Core上,代码的CGI处理(不计算下载时间)也至少在10秒内发生,而在FastCGI中,性能却是惊人的:最多处理1秒的页面,例如使用哪种Web语言PHP。

There are cases of websites done in Rails that supported 5 million hits a month, or approximately 115 per minute, a performance considered sufficient for 90% of current applications. In these sites, a frequent question is about the scalability of applications written in Rails. Unlike other technologies, you do not need a specific code that the system is prepared to “escalate”. When necessary we can adopt one of the tactics available to scale on Rails. Notably, the only problem of scalability is to maintain sessions between servers. Therefore, the output most obvious is to keep these sessions on NFS volumes, accessible by all application servers. Another tactic is to use session caching directly to the database. A third would save the session in a cookie on the user’s machine. As you can see, a Rails application is born with all the support necessary to grow painlessly.

在Rails中完成的网站案例中,每月支持500万次点击,或每分钟大约115次,这种性能足以满足当前90%的应用程序的需求。 在这些站点中,经常遇到的问题是有关用Rails编写的应用程序的可伸缩性。 与其他技术不同,您不需要系统准备“升级”的特定代码。 必要时,我们可以采用一种可在Rails上扩展的策略。 值得注意的是,可伸缩性的唯一问题是维护服务器之间的会话。 因此,最明显的输出是将这些会话保留在所有应用程序服务器都可以访问的NFS卷上。 另一种策略是直接使用会话缓存到数据库。 三分之一将会话保存在用户计算机上的cookie中。 如您所见,Rails应用程序天生具有无痛成长所需的所有支持。

Study: From Wikipedia, the free encyclopedia. The text is available under the Creative Commons.

研究:来自维基百科,免费的百科全书。 该文本可在“ 知识共享”下找到

翻译自: https://www.eukhost.com/blog/webhosting/ruby-on-rails-2/

ruby-on-rails

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/culu1614/article/details/107988859

智能推荐

JavaScript中Blob对象及示例_res.blob()-程序员宅基地

文章浏览阅读810次。Blob(binary large object)是计算机界通用术语之一,表示二进制大对象。在JavaScript中,Blob通常表示二进制数据,不过,它们不一定非得是大量数据,Blob也可以表示一个小型文本文件的内容_res.blob()

【Greenplum 6.9.0】Greenplum Command Center 6.2安装失败教程_greenplum command center无法下载-程序员宅基地

文章浏览阅读2k次。需要这个?gpperfmon_install --enable --password gpmon --port 5432-bash: gpperfmon_install: command not found直接安装?unzip gpcc.zip报错Failed to connect to database postgres on 127.0.0.1:5432 as gpadmin: libgssapi_krb5.so: cannot open shared object file: No s_greenplum command center无法下载

基于LVDS的高速自同步串行传输系统的研究_lvds总线-程序员宅基地

文章浏览阅读1.5k次,点赞2次,收藏8次。本文从高速数据传输的需求出发,对高速串行LVDS(Low Voltage Differential Signaling,低压差分信号)接口电路进行研究,重点对其传输方式进行了研究分析。基于SER/DES(Serial/Deserializer,串行/解串器)设计构架下,提出了高速自同步串行传输系统的实现方法。0 引言随着信息技术的日新月异,传统的I/O接口无法满足越来越大的数据处理任务。相对于串行传输技术,采取并行传输技术,提高通道数量就能提高数据传输数率,但是会增加很多成本。而且,并行传输技术中存在_lvds总线

vs2010和Matlab R2012a 混合编程_matlabr2012a怎么运行代码-程序员宅基地

文章浏览阅读1.7k次。转自:http://blog.sina.com.cn/s/blog_4fc6546101011cu5.html本人系统Windows 7旗舰版,32位,采用由m文件构造动态链接库然后在visual studio中调用的方法。1. MATLAB 环境配置: 注:Matlab r2010b及以后版本才支持vs2010, 之前版本中mbuild命令输入后可能会_matlabr2012a怎么运行代码

分治法之合并排序(2021/1/23)_分治法合并程序-程序员宅基地

文章浏览阅读247次。问题引入代码实现#include<iostream>#include<cstdlib>using namespace std;struct Data{ int flag;};void MergeFunction(struct Data*list,int low,int middle,int high){ //申请辅助空间 int size=high-low; struct Data*space=(struct Data*)malloc(sizeof(struc_分治法合并程序

正规文法构造状态转换图,状态转换图构造正规文法---编译原理_文法状态图-程序员宅基地

文章浏览阅读7.9k次,点赞19次,收藏104次。从左线性正规文法出发,构造状态图注意:增设初态S,单圆圈表示例子从右线性正规文法出发,构造状态图注意:增设终态Z,双圆圈表示例子状态转换图构造左线性正规文法注意:写左线性正规文法时从终态开始例子状态转换图构造右线性正规文法注意:写右线性正规文法时从初态开始例子..._文法状态图

随便推点

sentinel运行原理详解_sentinel原理-程序员宅基地

文章浏览阅读6.6k次,点赞5次,收藏41次。本文基于sentinel-1.8.0版本DegradeSlot:服务降级AuthoritySlot:黑白名单校验,按照字符串匹配,比较简单ClusterBuilderSlot:构建ClusterNode对象,该对象为后面统计QPS、线程数、异常、响应时间等使用。SystemSlot:校验QPS、线程数、系统负载、CPU,按照窗口统计StatisticSlot:统计处理过的请求数和线程数FlowSlot:按照自定义的流控规则检查,这个与StatisticSlot相关NodeSelectorS._sentinel原理

安全多方计算中通用混淆电路估值技术_电路估值密码学-程序员宅基地

文章浏览阅读218次。总序广义上而言SMPC分为两种实现方式,一类是使用布尔电路表述待计算函数,然后使用通用混淆电路来实现安全多方计算。另一类是使用域上的算术电路表述待计算函数,然后使用密码学方法实现安全多方计算。Yao氏混淆电路估值方案该方案可以用于实现对任何类型的门电路的安全估值。Lindell和Pinkas对该方案进行了严格的安全论证,证明该方案在半诚实模型下是安全的。下面简介姚氏混淆电路估值方案。令$C..._电路估值密码学

中文语义匹配_from eval import evaluate-程序员宅基地

文章浏览阅读533次。中文语义匹配_from eval import evaluate

Linux 查看 每个 cpu 的核心数_命令行 为什么查看每个cpu的核数不需要加 wc -l-程序员宅基地

文章浏览阅读3w次。Linux 查看 每个 cpu 的核心数cat /proc/cpuinfo | grep "processor" | grep "0" | wc -l_命令行 为什么查看每个cpu的核数不需要加 wc -l

解决 LINK : fatal error LNK1158: cannot run ‘rc.exe‘_qt cannot run rc.exe-程序员宅基地

文章浏览阅读1k次。问题安装 mmcv时报错 LINK : fatal error LNK1158: cannot run ‘rc.exe’原因这是找不到rc.exe导致问题解决措施在 C:\Program Files (x86)\Windows Kits\8.1\bin\x86 下找到rcdll.dll 和rc.exe复制到VC安装路径中,我的是 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin再次运行,安装成功Looking in inde_qt cannot run rc.exe

WPS宏开发之VBA宏转JS宏_vba转js-程序员宅基地

文章浏览阅读9.2k次,点赞10次,收藏78次。WPS宏开发 VBA宏转JS宏_vba转js

推荐文章

热门文章

相关标签