<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
 <channel>
  <title>ROR学习笔记</title>
  <link>http://ror.blogbus.com</link>
  <description><![CDATA[记录Ruby On Rails的学习心得]]></description>
  <generator> by blogbus.com </generator>
  <lastBuildDate>Thu, 27 Oct 2005 14:37:31 +0800</lastBuildDate>
  <image>
									<url>http://public.blogbus.com/images/head.gif</url>
									<title>ROR学习笔记</title>
									<link>http://ror.blogbus.com</link>
								</image>  <item>
   <title>初学Ruby感受</title>
   <description><![CDATA[初次听说Ruby那是今年3月份左右，当听到Ruby的快速编程时，我还有点不相信，总认为Java已经很强大，便捷了，很难相信Ruby比它更加强大，便捷。但是随着老师还有Todayhill的介绍，我开始对它动心了。于是快速看了Ruby的介绍，简单的语法，然后按着Programing ruby上写了几个小程序，发现Ruby两大优势：<br /><br />更加面向对象；<br /><br />程序编写更加快捷，工作量小。&nbsp;<br /><br /><!--sp--><div class="relpost"><br/><h3>随机文章：</h3><div><a href="http://ror.blogbus.com/logs/2323058.html">项目终于基本完成</a> 2006-04-22</div><div><a href="http://ror.blogbus.com/logs/1739141.html">Ruby的callback实现</a> 2005-12-23</div><div><a href="http://ror.blogbus.com/logs/1725942.html">关于ROR+MYSQL的中文编码问题</a> 2005-12-20</div><div><a href="http://ror.blogbus.com/logs/1723870.html">ROR的目录体系</a> 2005-12-19</div><div><a href="http://ror.blogbus.com/logs/1679217.html">关于ROR的OR MAPPING</a> 2005-12-08</div></div><div class="addfav"><br />收藏到：<span class= "delicious"><a href="http://del.icio.us/post?v=4&noui&jump=close&url=http%3A%2F%2Fror.blogbus.com%2Flogs%2F11780724.html&title=%E5%88%9D%E5%AD%A6Ruby%E6%84%9F%E5%8F%97">Del.icio.us</a></span></div><br><br><div class="sysmsg"><b><a href="http://www.gov.cn/zwgk/2008-05/18/content_981560.htm">深切哀悼四川汶川大地震遇难同胞</a></b><br><br></div>]]></description>
   <link>http://ror.blogbus.com/logs/11780724.html</link>
   <author>棍子</author>
   <pubDate>Sun, 09 Dec 2007 20:59:57 +0800</pubDate>
  </item>
  <item>
   <title>DB2ONRAILS</title>
   <description><![CDATA[&nbsp;&nbsp;&nbsp; 最近公司的一次会上得了一件DB2 Express-C的T-shirt. 我对DB2 EXP的印象还不错，总有短小精干的感觉，当然，最主要一点就是它免费----可能我对所有免费的东西印象都不错。<br /><br />&nbsp;&nbsp;&nbsp; DB2 team把支持动态语言作为一个未来工作的重点，当然ROR的支持就是重中之重了。在DB2的开发team中特别抽出了人专门做这个DB2OnRails的开发.这个项目在AlphaWorks上也有.在那里，它叫D...<!--sp--><div class="relpost"><br/><h3>随机文章：</h3><div><a href="http://ror.blogbus.com/logs/11519868.html">不能结束的ROR</a> 2007-12-05</div><div><a href="http://ror.blogbus.com/logs/2323058.html">项目终于基本完成</a> 2006-04-22</div><div><a href="http://ror.blogbus.com/logs/1737475.html">RAILS和轻量级JAVA架构的的MVC哲学</a> 2005-12-22</div><div><a href="http://ror.blogbus.com/logs/1733858.html">ROR的表单validator</a> 2005-12-21</div><div><a href="http://ror.blogbus.com/logs/1725942.html">关于ROR+MYSQL的中文编码问题</a> 2005-12-20</div></div><div class="addfav"><br />收藏到：<span class= "delicious"><a href="http://del.icio.us/post?v=4&noui&jump=close&url=http%3A%2F%2Fror.blogbus.com%2Flogs%2F11640843.html&title=DB2ONRAILS">Del.icio.us</a></span></div><br><br><div class="sysmsg"><b><a href="http://www.gov.cn/zwgk/2008-05/18/content_981560.htm">深切哀悼四川汶川大地震遇难同胞</a></b><br><br></div>]]></description>
   <link>http://ror.blogbus.com/logs/11640843.html</link>
   <author>todayhill</author>
   <pubDate>Fri, 07 Dec 2007 11:36:40 +0800</pubDate>
  </item>
  <item>
   <title>不能结束的ROR</title>
   <description><![CDATA[&nbsp;&nbsp;&nbsp; 今天在GOOGLE上搜索ROR，第一页就有我们这个BLOG。转眼一看，上篇BLOG居然都是一年前了，这一年过的好快，也好忙，直到现在，感觉刚刚松了一小口气。<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; ROR在这一年里也在如设想般发展，可是企业应用似乎并没有呈井喷方式出现。<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; 现在我继续关注ROR，正好有了一个DH的空间，有机会写点自己的小应用了。最近正在做一个RO...<!--sp--><div class="relpost"><br/><h3>随机文章：</h3><div><a href="http://ror.blogbus.com/logs/11640843.html">DB2ONRAILS</a> 2007-12-07</div><div><a href="http://ror.blogbus.com/logs/2323058.html">项目终于基本完成</a> 2006-04-22</div><div><a href="http://ror.blogbus.com/logs/1737475.html">RAILS和轻量级JAVA架构的的MVC哲学</a> 2005-12-22</div><div><a href="http://ror.blogbus.com/logs/1733858.html">ROR的表单validator</a> 2005-12-21</div><div><a href="http://ror.blogbus.com/logs/1725942.html">关于ROR+MYSQL的中文编码问题</a> 2005-12-20</div></div><div class="addfav"><br />收藏到：<span class= "delicious"><a href="http://del.icio.us/post?v=4&noui&jump=close&url=http%3A%2F%2Fror.blogbus.com%2Flogs%2F11519868.html&title=%E4%B8%8D%E8%83%BD%E7%BB%93%E6%9D%9F%E7%9A%84ROR">Del.icio.us</a></span></div><br><br><div class="sysmsg"><b><a href="http://www.gov.cn/zwgk/2008-05/18/content_981560.htm">深切哀悼四川汶川大地震遇难同胞</a></b><br><br></div>]]></description>
   <link>http://ror.blogbus.com/logs/11519868.html</link>
   <author>todayhill</author>
   <pubDate>Wed, 05 Dec 2007 10:14:02 +0800</pubDate>
  </item>
  <item>
   <title>Rails 4 days中文版（第一天）</title>
   <description><![CDATA[<p>ROR的学习总是断断续续的，有一部分原因是自己英文水平不行，读起参考手册那种比较庞大的东西感觉有些吃力，最近算是有些时间，所以找来《Rails 4 days》这个小家伙希望再迅捷的学习学习ROR的一些精华。</p><p>一边看一边翻译吧，虽然不是很难，但自己翻译能力实在一般，所以这东西只是个实验品，顺便也督促一下自己的学习进度，先发个介绍和第一天的内容，以后会慢慢补上，希望对大家有用。</p><p><a href="http://www.foodboox.com/r4d/Rails%204%20days.doc" target="blank">点此下载</a></p><!--sp--><div class="relpost"><br/><h3>随机文章：</h3><div><a href="http://ror.blogbus.com/logs/2323058.html">项目终于基本完成</a> 2006-04-22</div><div><a href="http://ror.blogbus.com/logs/1733858.html">ROR的表单validator</a> 2005-12-21</div><div><a href="http://ror.blogbus.com/logs/1729760.html">rails笔记（动手前先看书）</a> 2005-12-21</div><div><a href="http://ror.blogbus.com/logs/1725942.html">关于ROR+MYSQL的中文编码问题</a> 2005-12-20</div><div><a href="http://ror.blogbus.com/logs/1723870.html">ROR的目录体系</a> 2005-12-19</div></div><div class="addfav"><br />收藏到：<span class= "delicious"><a href="http://del.icio.us/post?v=4&noui&jump=close&url=http%3A%2F%2Fror.blogbus.com%2Flogs%2F2942284.html&title=Rails+4+days%E4%B8%AD%E6%96%87%E7%89%88%EF%BC%88%E7%AC%AC%E4%B8%80%E5%A4%A9%EF%BC%89">Del.icio.us</a></span></div><br><br><div class="sysmsg"><b><a href="http://www.gov.cn/zwgk/2008-05/18/content_981560.htm">深切哀悼四川汶川大地震遇难同胞</a></b><br><br></div>]]></description>
   <link>http://ror.blogbus.com/logs/2942284.html</link>
   <author>foodboox</author>
   <pubDate>Sun, 30 Jul 2006 22:04:20 +0800</pubDate>
  </item>
  <item>
   <title>项目终于基本完成</title>
   <description><![CDATA[<p>     经过几个月的学习和努力，我这个用ROR做的进销存系统终于告一段落了。因为一直都很忙，都没时间上来把后面用到的东西写上。在这段时间我用到了ROR的login_generator 好像大概是这么个名字，就是用来自动生成系统的权限验证部分的。另外还用到了file_column，用来进行文件上传的组件。除此之外，还在几个地方用了AJAX，也摩登了一把。总体来说，ROR里面资源还是很丰富的，需要的东西基本都可以找的到。</p><p>    当然，经过这一个项目，对ROR的认识又深了一步，也发现了一些它的一些缺点。总体来说，感觉它距离大规模企业级应用还有不近的路要走。我下来会尽量找时间来好好总结一下我用到的ROR相关的技术和一些个人体会。</p><p>    我的个人邮箱是<a href="mailto:todayhill@tom.com">todayhill@tom.com</a>，如果有朋友想跟我联系可以给我写信。另外，<a href="http://www.railscn.com  才是人才济济,我个人也在上面获得了">www.railscn.com  才是人才济济,我个人也在上面获得了</a>大量的帮助.大家可以常常去看一看.</p><!--sp--><div class="relpost"><br/><h3>随机文章：</h3><div><a href="http://ror.blogbus.com/logs/1725942.html">关于ROR+MYSQL的中文编码问题</a> 2005-12-20</div><div><a href="http://ror.blogbus.com/logs/1723870.html">ROR的目录体系</a> 2005-12-19</div><div><a href="http://ror.blogbus.com/logs/1733858.html">ROR的表单validator</a> 2005-12-21</div><div><a href="http://ror.blogbus.com/logs/11780724.html">初学Ruby感受</a> 2007-12-09</div><div><a href="http://ror.blogbus.com/logs/11640843.html">DB2ONRAILS</a> 2007-12-07</div></div><div class="addfav"><br />收藏到：<span class= "delicious"><a href="http://del.icio.us/post?v=4&noui&jump=close&url=http%3A%2F%2Fror.blogbus.com%2Flogs%2F2323058.html&title=%E9%A1%B9%E7%9B%AE%E7%BB%88%E4%BA%8E%E5%9F%BA%E6%9C%AC%E5%AE%8C%E6%88%90">Del.icio.us</a></span></div><br><br><div class="sysmsg"><b><a href="http://www.gov.cn/zwgk/2008-05/18/content_981560.htm">深切哀悼四川汶川大地震遇难同胞</a></b><br><br></div>]]></description>
   <link>http://ror.blogbus.com/logs/2323058.html</link>
   <author>todayhill</author>
   <pubDate>Sat, 22 Apr 2006 11:27:38 +0800</pubDate>
  </item>
  <item>
   <title>Ruby的callback实现</title>
   <description><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>&nbsp;&nbsp;&nbsp; 初学</SPAN>Ruby<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>给我留下印象最深的</SPAN>callback<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>的实现，即</SPAN>Ruby<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>的</SPAN>block<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>。它给我的感觉是很新颖，很有想法，也很大胆。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>以前我也曾接触过一些其他语言的</SPAN>callback<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>的实现，但都没有真正理解其中的精髓。直到看了</SPAN>Ruby<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>的</SPAN>block<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>，我才突感茅塞顿开，好像积压在心头的一块大石一下子被拿开了一样。</SPAN>Ruby<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>似乎就是为了</SPAN>block<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>而生的（好像有些绝对了，只是为了表达一下喜悦的心情：</SPAN>P<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>）。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>&nbsp;&nbsp;&nbsp; 下面就是一个</SPAN>Ruby<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>的</SPAN>block<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>的小例子：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt" align=left><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class SayHello</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt" align=left><FONT size=2><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>def say_hello</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt" align=left><FONT size=2><FONT face="Courier New"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>hello = ‘hi ’</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt" align=left><FONT size=2><FONT face="Courier New"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>yield hello</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt" align=left><FONT size=2><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</SPAN>end</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt" align=left><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;end</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt" align=left><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;SayHello.say_hello{|greeting| print greeting, ‘<CITY w:st="on"><PLACE w:st="on">tracy</PLACE></CITY>’}</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times><EM>&nbsp;&nbsp;&nbsp; 结果如下：</EM></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hi tracy</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>&nbsp;&nbsp;&nbsp; 它的执行过程是这样的，系统调用</SPAN>SayHello<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>的</SPAN>say_hello<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>方法，并带有一个</SPAN>block<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>，即</SPAN>{}<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>中的代码，以后简称“块”。块中的代码首先被记录下来，然后开始执行</SPAN>say_hello<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>方法，先是将</SPAN>‘hi’<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>赋值给变量</SPAN>hello,<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>接着遇到</SPAN>yield<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>关键字，这时之前被记录下来的块中的代码会将</SPAN>yield<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>取代，而</SPAN>yield<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>后面的变量</SPAN>hello<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>赋给块里</SPAN>||<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>所夹的变量，这时方法</SPAN>say_hello<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>的代码就好像是下面这样：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def say_hello</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><FONT size=2><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>hello = ‘hi ’</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><FONT size=2><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>print ‘hi’,’<CITY w:st="on"><PLACE w:st="on">tracy</PLACE></CITY>’</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>&nbsp;&nbsp;&nbsp; 它所产生的结果会是</SPAN>hi tracy<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>就不难理解了。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>&nbsp;&nbsp;&nbsp; 我觉得这种机制的新颖之处就在于它将一段代码作为了方法的参数，这样就大大增强了方法的灵活性，而如此灵活的设计并非一定是好事，它就像一把双刃剑，程序员需要理解它更深层次的意思，明白</SPAN>Ruby<SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: " Roman?? New ?Times mso-hansi-font-family: Roman?; Times>语言设计者的良苦用心，正确的使用，这样它必将发挥巨大的作用！否则，代码将会复杂难懂，破败不堪。</SPAN></P><!--sp--><div class="relpost"><br/><h3>随机文章：</h3><div><a href="http://ror.blogbus.com/logs/1550903.html">初步体验Ruby（二）</a> 2005-10-30</div><div><a href="http://ror.blogbus.com/logs/11780724.html">初学Ruby感受</a> 2007-12-09</div><div><a href="http://ror.blogbus.com/logs/2323058.html">项目终于基本完成</a> 2006-04-22</div><div><a href="http://ror.blogbus.com/logs/1725942.html">关于ROR+MYSQL的中文编码问题</a> 2005-12-20</div><div><a href="http://ror.blogbus.com/logs/1723870.html">ROR的目录体系</a> 2005-12-19</div></div><div class="addfav"><br />收藏到：<span class= "delicious"><a href="http://del.icio.us/post?v=4&noui&jump=close&url=http%3A%2F%2Fror.blogbus.com%2Flogs%2F1739141.html&title=Ruby%E7%9A%84callback%E5%AE%9E%E7%8E%B0">Del.icio.us</a></span></div><br><br><div class="sysmsg"><b><a href="http://www.gov.cn/zwgk/2008-05/18/content_981560.htm">深切哀悼四川汶川大地震遇难同胞</a></b><br><br></div>]]></description>
   <link>http://ror.blogbus.com/logs/1739141.html</link>
   <author>夜---</author>
   <pubDate>Fri, 23 Dec 2005 11:45:45 +0800</pubDate>
  </item>
  <item>
   <title>RAILS和轻量级JAVA架构的的MVC哲学</title>
   <description><![CDATA[<p>    随着这些天来对RAILS的学习,渐渐感受着ROR开发快速所带来的欣喜,可是在这惊喜过后也自然把它跟JAVA架构做了一些比较.</p><p>    这些天来最大的感觉就是,JAVA的架构比ROR要&quot;干净&quot;的多.而这里的&quot;干净&quot;与&quot;不干净&quot;实际上却正是我接触OO以来在一个含混不清的问题,归根结底就是面向对象里面&quot;类的封装范围&quot;.</p><p>    记得在以前刚开始学习OO的时候就说&quot;类可以封装一系列属性和方法&quot;.好,那时候经常以Persion来做例子,人有身高有体重,有爱好有性格,这些都是属性,人还能吃饭能睡觉,这些是方法,好了,这些都是人的特征,所以都被&quot;人&quot;这个类来封装.多么完美的OO,我们简直是在创造世界!可是现实通常却不像想的那么完美,我想上帝创造世界的工作也一定不是一件轻松的事情.我们的系统通常要具有分布性,对象应该可以在不同的机器上传来传去,那好,为了这样的要求,在J2EE的架构设计中,常常要把M这一层再分为静态层和动态层两个层次,这样也就有了我们的service和domain以及他们之间的dao.软件设计中,通常是通过引入一个中间层来解决一些问题,而我们这里引入的中间层把&quot;静&quot;和&quot;动&quot;分开了.我想这里不仅仅是为了解决分布的问题,通常经验还告诉我们,&quot;动&quot;的部分改变的几率是远远大于&quot;静&quot;的.所以用OO来把这&quot;动&quot;和&quot;静&quot;分别封装.可这又跟我们刚开始的类设计理论似乎有些不一样了,不过,这样的设计是为了实际而做的牺牲还是对OO的活学活用呢?恐怕说出来也会是人们一个争论的话题吧.</p><p>    而ROR似乎对OO更友好,学过OO的人很容易就能理解它,它的model封装了静和动两部分,包括一些验证的操作都放在model里面了,根本不分service和domain这两部分.这一切都符合我们刚开始所学到的OO,可是~有了对JAVA的理解和使用经验,我越来越觉得,跟JAVA相比这分明是一种&quot;肮脏&quot;,混杂的类设计.不过,这样做也是有它的道理的,ROR里面的对象可以分布传输吗?分布传输过去的对象,里面的方法还可以调用吗?如果这个方法访问了本地资源,这一调用出错了怎么办?这一切的解决方法,可能就是&quot;不让对象分布出去&quot;吧,至少我现在还没有在ROR上看到有讲类似RMI和EJB级别的东西,它似乎是用WEB SERVICE来代替这些作为分布的解决方案,可是上面那些问题在WEB SERVICE中是怎么做的,我就没有研究过了.</p><p>    上面的一些话只是现阶段的一些个人感觉,也不排除随着对ROR的学习深入而有所改变的可能.</p><!--sp--><div class="relpost"><br/><h3>随机文章：</h3><div><a href="http://ror.blogbus.com/logs/11640843.html">DB2ONRAILS</a> 2007-12-07</div><div><a href="http://ror.blogbus.com/logs/11519868.html">不能结束的ROR</a> 2007-12-05</div><div><a href="http://ror.blogbus.com/logs/2323058.html">项目终于基本完成</a> 2006-04-22</div><div><a href="http://ror.blogbus.com/logs/1733858.html">ROR的表单validator</a> 2005-12-21</div><div><a href="http://ror.blogbus.com/logs/1725942.html">关于ROR+MYSQL的中文编码问题</a> 2005-12-20</div></div><div class="addfav"><br />收藏到：<span class= "delicious"><a href="http://del.icio.us/post?v=4&noui&jump=close&url=http%3A%2F%2Fror.blogbus.com%2Flogs%2F1737475.html&title=RAILS%E5%92%8C%E8%BD%BB%E9%87%8F%E7%BA%A7JAVA%E6%9E%B6%E6%9E%84%E7%9A%84%E7%9A%84MVC%E5%93%B2%E5%AD%A6">Del.icio.us</a></span></div><br><br><div class="sysmsg"><b><a href="http://www.gov.cn/zwgk/2008-05/18/content_981560.htm">深切哀悼四川汶川大地震遇难同胞</a></b><br><br></div>]]></description>
   <link>http://ror.blogbus.com/logs/1737475.html</link>
   <author>todayhill</author>
   <pubDate>Thu, 22 Dec 2005 21:21:35 +0800</pubDate>
  </item>
  <item>
   <title>ROR的表单validator</title>
   <description><![CDATA[<br><!--sp--><div class="relpost"><br/><h3>随机文章：</h3><div><a href="http://ror.blogbus.com/logs/2323058.html">项目终于基本完成</a> 2006-04-22</div><div><a href="http://ror.blogbus.com/logs/1725942.html">关于ROR+MYSQL的中文编码问题</a> 2005-12-20</div><div><a href="http://ror.blogbus.com/logs/1723870.html">ROR的目录体系</a> 2005-12-19</div><div><a href="http://ror.blogbus.com/logs/11640843.html">DB2ONRAILS</a> 2007-12-07</div><div><a href="http://ror.blogbus.com/logs/11519868.html">不能结束的ROR</a> 2007-12-05</div></div><div class="addfav"><br />收藏到：<span class= "delicious"><a href="http://del.icio.us/post?v=4&noui&jump=close&url=http%3A%2F%2Fror.blogbus.com%2Flogs%2F1733858.html&title=ROR%E7%9A%84%E8%A1%A8%E5%8D%95validator">Del.icio.us</a></span></div><br><br><div class="sysmsg"><b><a href="http://www.gov.cn/zwgk/2008-05/18/content_981560.htm">深切哀悼四川汶川大地震遇难同胞</a></b><br><br></div>]]></description>
   <link>http://ror.blogbus.com/logs/1733858.html</link>
   <author>todayhill</author>
   <pubDate>Wed, 21 Dec 2005 23:59:33 +0800</pubDate>
  </item>
  <item>
   <title>rails笔记（动手前先看书）</title>
   <description><![CDATA[<p>        之所以写这篇日志是因为在开始rails时浪费了大量的时间在调试环境上，因为很久前按照一个教程搭建过ROR工程，所以理所应当的感觉很简单，但相隔很长时间很多基础的概念都没有记住，所以犯了很低级的错误，要是动手前温习一下教程或者看看英文文档就不至于浪费时间了。</p><p>        看山给我介绍了<a href="http://www.redrails.org" target="_blank">redrails</a>这个IDE，因为我在win上做有没有装eclipse，所以只下了单独运行的文件，还好是绿色软件，只要有java环境就可以了，在第一步建立工程时问题随之出现，首先是workspace，这个指定一个公共目录就好了，比如“railsCode”，以后每个项目都放在里面，IDE建立工程其实等价于命令行workspace目录下运行rails 工程名，建好后会产生所有rails需要的基本目录结构，包括script里面的server（注：经我测试在win下用redrails直接运行项目的server会经常出错，而且严重到直接关闭IDE抛出异常，再次启动时server里找不到启动项，不过用命令行找到workspace目录下运行ruby script\server可以启动，我在这里费了大劲，起初还以为是项目部署的问题~），访问127.0.0.1:3000会出现Congratulations页面，这个页面就是项目\public\index.html页面，数据库配置文件，也就是我们平时写脚本所谓的CONN是项目\config\database.yml文件，在这里设置mysql设置密码似乎还会出现问题~改写后要重启server，切记！</p><p>        最令我难堪的问题是项目访问路径，没看书我理所应当的按照127.0.0.1:3000\项目名访问，结果总是找不到路径（竟然为了这么一个问题熬到凌晨3点多，压根就没考虑查一下资料），其实是根本没有了解清rails的url机制，虽然现在不是了解得很全面，但知道以现在这种server的启动方式根本不存在虚拟目录的问题，也就是直接用127.0.0.1:3000访问的就是server所在项目的首页，而其他页面完全靠controller类来指定（controller类文件放在项目\app\controllers目录下），比如我新建test_controller.rb（用redrails时只要命名controller叫test即可，命令行需在项目下运行ruby script\generate controller test）,这是项目中会同时产生四个文件app\controllers\test_controller.rb; app\helpers\test_helper.rb; app\view\test\; test\functional\test_controller_test.rb</p><p>此时访问127.0.0.1:3000\test会出现“</p><h1>Unknown action</h1><p>No action responded to index</p><p>”<br />查资料后修改test_controller.rb内容为“</p><p>class TestController &lt; ApplicationController<br /> def index<br />  render_text&quot;这是测试页&quot;<br /> end<br />end</p><p>”后再次访问以上路径就会出现“这是测试页”的字样了，而定义其他url同理增加新的def就可以了，不过是否所有url都要这样来定义我还没有搞清？rails里model实现比较简单，单数对复数即model里定义test.rb则DB建tests表影射，然后在controller里的test_controller.rb加scaffold:test就ok了，最基础的list、show、edit、delete操作及表单在这之后自动生成127.0.0.1:3000\test\list</p><p>可以自己定义页面模版，比如想订制list页面的，就在test_controller.rb里加入</p><p>&quot;def list...end”然后编辑view\test\list.rhtml即可，由于...内容与模版中动态程序的书写有关，有时间还需要进一步研究，大概就是数据库对象的声明一类。</p><p>PS：太晚了，随做随学随写吧</p><!--sp--><div class="relpost"><br/><h3>随机文章：</h3><div><a href="http://ror.blogbus.com/logs/2942284.html">Rails 4 days中文版（第一天）</a> 2006-07-30</div><div><a href="http://ror.blogbus.com/logs/2323058.html">项目终于基本完成</a> 2006-04-22</div><div><a href="http://ror.blogbus.com/logs/1733858.html">ROR的表单validator</a> 2005-12-21</div><div><a href="http://ror.blogbus.com/logs/1725942.html">关于ROR+MYSQL的中文编码问题</a> 2005-12-20</div><div><a href="http://ror.blogbus.com/logs/1723870.html">ROR的目录体系</a> 2005-12-19</div></div><div class="addfav"><br />收藏到：<span class= "delicious"><a href="http://del.icio.us/post?v=4&noui&jump=close&url=http%3A%2F%2Fror.blogbus.com%2Flogs%2F1729760.html&title=rails%E7%AC%94%E8%AE%B0%EF%BC%88%E5%8A%A8%E6%89%8B%E5%89%8D%E5%85%88%E7%9C%8B%E4%B9%A6%EF%BC%89">Del.icio.us</a></span></div><br><br><div class="sysmsg"><b><a href="http://www.gov.cn/zwgk/2008-05/18/content_981560.htm">深切哀悼四川汶川大地震遇难同胞</a></b><br><br></div>]]></description>
   <link>http://ror.blogbus.com/logs/1729760.html</link>
   <author>foodboox</author>
   <pubDate>Wed, 21 Dec 2005 01:04:46 +0800</pubDate>
  </item>
  <item>
   <title>关于ROR+MYSQL的中文编码问题</title>
   <description><![CDATA[<P>MYSQL的中文问题确实非常麻烦,在JAVA开发中就曾经耗费我无数脑细胞来解决这个问题,想必在ROR下面也不是一个非常容易的事情,这个帖子谈论这个话题很全面了,在这里记录一下:</P>
<P><A href="http://www.railscn.com/viewtopic.php?t=211">http://www.railscn.com/viewtopic.php?t=211</A></P><!--sp--><div class="relpost"><br/><h3>随机文章：</h3><div><a href="http://ror.blogbus.com/logs/2323058.html">项目终于基本完成</a> 2006-04-22</div><div><a href="http://ror.blogbus.com/logs/1723870.html">ROR的目录体系</a> 2005-12-19</div><div><a href="http://ror.blogbus.com/logs/1733858.html">ROR的表单validator</a> 2005-12-21</div><div><a href="http://ror.blogbus.com/logs/11780724.html">初学Ruby感受</a> 2007-12-09</div><div><a href="http://ror.blogbus.com/logs/11640843.html">DB2ONRAILS</a> 2007-12-07</div></div><div class="addfav"><br />收藏到：<span class= "delicious"><a href="http://del.icio.us/post?v=4&noui&jump=close&url=http%3A%2F%2Fror.blogbus.com%2Flogs%2F1725942.html&title=%E5%85%B3%E4%BA%8EROR%2BMYSQL%E7%9A%84%E4%B8%AD%E6%96%87%E7%BC%96%E7%A0%81%E9%97%AE%E9%A2%98">Del.icio.us</a></span></div><br><br><div class="sysmsg"><b><a href="http://www.gov.cn/zwgk/2008-05/18/content_981560.htm">深切哀悼四川汶川大地震遇难同胞</a></b><br><br></div>]]></description>
   <link>http://ror.blogbus.com/logs/1725942.html</link>
   <author>todayhill</author>
   <pubDate>Tue, 20 Dec 2005 14:06:45 +0800</pubDate>
  </item>
 </channel>
</rss>
