惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
Netflix TechBlog - Medium
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
V
V2EX
IT之家
IT之家
J
Java Code Geeks
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
GbyAI
GbyAI
D
Docker
S
Secure Thoughts
Recent Announcements
Recent Announcements
Webroot Blog
Webroot Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
云风的 BLOG
云风的 BLOG
博客园_首页
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Security Archives - TechRepublic
Security Archives - TechRepublic
酷 壳 – CoolShell
酷 壳 – CoolShell
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News | PayPal Newsroom
S
Security @ Cisco Blogs
I
InfoQ
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
W
WeLiveSecurity
T
Troy Hunt's Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Attack and Defense Labs
Attack and Defense Labs
美团技术团队
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
B
Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Scott Helme
Scott Helme
T
Tor Project blog
Know Your Adversary
Know Your Adversary
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
Recorded Future
Recorded Future
C
Cyber Attacks, Cyber Crime and Cyber Security
AI
AI
G
Google Developers Blog

博客园 - Michael Peng

用马尔科夫模型做拼写检查 商业软件编程很无聊(转载) VS2010 Debugger bug 编程之初 编程之美 1.4买书问题常数时间空间解法 vc2010 std::tr1 bind库捉虫记 用vs2010编译kigg 3.0遇到的问题 在vs中获得当前所有快捷键代码 最近的一些面试感悟 这两天被vs2010的std::tr1::bind郁闷了 error C2065: '__LINE__Var' : undeclared identifier 写错名字了 啰嗦几句,关于动机,学习与批评,架构和代码风格 金山卫士代码批评 24点计算 部门开始做技术talk 数据库的坏味道 --《Refactoring Database: Evolutionary Database Design》读书笔记 偷天换日 ruby解数独问题
初识rails
Michael Peng · 2010-05-08 · via 博客园 - Michael Peng

使用到的软件

ruby186-27_rc2.exe

mysql-5.1.44-win32.msi

libmysql.dll

安装和配置rails不是一帆风顺,为了不再重复痛苦经历,把安装过程写到批处理里再发到博客上似乎是个不错的做法

call gem update --systems

call gem install rails

call gem install mysql

copy libmysql.dll d:\ruby\bin

关于最后一句命令的解释,参见这篇帖子

基本的学习过程就是按Getting Startted with Rails一步一步下来,不到一个小时对rails能有一个第一印象。

正好前一阵摸了一下java web开发,都还未达到入门级别,就胡诌一下俺对这两种开发模式的印象吧。

  1. ActiveRecord搞定了ORM,不用再重复去做无聊的事情。对于被ibatis折磨得抓狂的人来说无疑是一大福音。
  2. routes.rb来完成http request到controller的映射,感觉比struts配置要简单。
  3. ActiveRecord在字段校验上已经帮你做了很多事情了,在java web中对DO对象的校验就不是一件简单的事情。首先是强大的ruby让ActiveRecord的字段校验表示非常简单。其次有统一的校验点如save, update, create等处,而Java的DO对象由于把数据库访问交给了DAO,校验时机啥的就要程序员自己去定义。选择多了不一定是好事,有个缺省的能用就蛮好。
  4. association在很多场合能节省重复逻辑。
  5. 数据库迁移已经预定义好了一套程序,偶真的很想把这套逻辑移植到现在做的那个java项目上去。

初体验,先写这么多吧。