PCSH91_305 板


LINE

http://blog.xdite.net/ http://yehudakatz.com/ Rails 3 的野望 (Rails 合并 Merb 後目前的进展) 这一篇想写很久了,一直忘记。 大家应该还记得,Merb 在 2008 年底宣布了一个决定,他们决定并入 Rails。而 Merb 的 Team Leader:Yehuda Katz,也将加入 Rails core team 开发。於是未来 Merb2 将 直接等於 Rails3。 当时,这件事是非常令人震撼的。原因是 Rails 虽然是一个非常先进的框架,但是还是 有非常多开发者,因为它的包山包海(笨重、效能不彰)而却步。於是,他们选择了另外 一套框架 Merb。Merb 的想法和架构其实是很棒的,它既可以是一个 full stack 的 Framework,又可以让开发者用 cherry pick library 的方式建构网站。有很多 Merb 派的开发者,甚至就是因为前述原因才跳槽过来的。 因此它们的合并,无异是向社群投了一个大炸弹。很多 Merb 的拥护者当时纷纷表示不能 接受,甚至大家都涌上「Merb core team 的人是集体脑袋烧坏掉了吗」的强烈疑惑,认 为 Merb 选择被 Rails 整并是大错特错的愚蠢决定。 我当初也这麽想,但近半年来,追看 Edge Rails 的发展,我才发现所有人(包括 DHH) ,都被 Yehuda 骗了。 在 DHH 当初的 Announce 提到了 Rails 3 将会有的是: * Rails core: Yes, Rails is a full-stack framework and will remain so, but there’s no reason we shouldn’t also make it possible to run with less than the full monty. Rails 3 will make it easy to run just a bare minimum and then allow you to opt in just the stuff you want, if that’s necessary for your particular situation. Think “rails myapp—core” (and “rails myapp— flat”). * Performance optimizations: Merb has a lot of Rails pieces rewritten to be faster. We’ll be bringing all that good stuff over. We’ll also bend the architecture in the places where that’s necessary for a big yield. In short, Rails 3 will get all the performance attention that the Merb guys are known for. * Framework agnosticism: Rails will always have a default answer to every question within the stack. If you don’t care about testing frameworks, you’ ll get test/unit. If you don’t care about which ORM, you’ll get Active Record. But some people do care and want something else. Some people want RSpec for testing, others want to use Sequel or Data Mapper for ORM, others again prefer Haml for templating, and some might prefer jQuery for Ajax. All these people should feel like Rails is welcoming them with open arms. Yes, we ’ll have a default, but we shouldn’t have any form of discrimination against alternatives. * Rigorous API: Too many plugins break when Rails is updated because it’ s not clear where they can safely hook into the internals and when they’re monkeypatching and should expect things to break. The Merb guys committed to a public API with tests to ensure that it wouldn’t break. They’ll bring over that line of thinking and give Rails 3 a tested and documented API for extensions that won’t break willy-nilly with upgrades. 大家看到 Rigorous API 这段 一定以为 Yehuda 当初的提议是的改版是,发明一套神奇 的 API,让 plugin 不再烂掉。再加上前三条以上 blahblah 的好处 …不过大家看的半 信半疑,感觉上好像都是虎烂,应该完全做不到吧….。 OK。但到目前为止,结果 Yehuda 目前的成果到了什麽地步呢? Merb 反过来吃掉了 Rails,顺便叫 Sinatra 也不用继续再玩了! 他现在做的事,并不是发明什麽神奇的 API 。而是把整个 Rails refactor,具体的作法 就是把整个 Rails 全部拆散成 API 形式再组起来 ……这不仅是空谈,而是已经有非常 具体的成果了。 1. 现在 Rails 的效能跟 Merb 一样好!! ( 2008/08/09 ) merb 2. Fully API ( 这在他最近在世界上的各场 ruby / rails conf 演讲 影片/ 投影片 都有 demo ) 3. 因为现在通通拆开了,所以 Rails3 达成 framework agnosticism 是完全没问题的… 4. 因为现在通通拆开了,very flat 版 rails 也是没有问题的… 5. 他最近甚至无聊到火力展示(炫耀)一个东西,如何用 Rails API 拼出一个 Sinatra 。XDDDDDDD 6. 还顺便分享了一篇 refactor 技巧(因为公开翻修了 Rails 这个 opensource project ):6 Steps To Refactoring Rails (for Mere Mortals) 完全令人想不到而且伟大的结局啊,完全做的到而且比当初宣告的更屌….。 真期待年底 Rails3 的正式 Release …. ==== Update : 刚刚重回去看 Merb gets merged into Rails 3!,想仔细找找有没有什麽我写漏的。结果看到 DHH 在 当初的文章里强调了这次的 merge「This is not a big bang rewrite」。我噗吃一声, 笑出来了………… --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.161.98.57
1F:→ nfsong:it works 09/11 13:19







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:BuyTogether站内搜寻

TOP