<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Wilkin Ho&#039;s Blog</title>
	<atom:link href="http://wilkinho.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://wilkinho.wordpress.com</link>
	<description>all my words</description>
	<lastBuildDate>Thu, 05 Nov 2009 13:43:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='wilkinho.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Wilkin Ho&#039;s Blog</title>
		<link>http://wilkinho.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://wilkinho.wordpress.com/osd.xml" title="Wilkin Ho&#039;s Blog" />
	<atom:link rel='hub' href='http://wilkinho.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Thinking sphinx CJK support experiment</title>
		<link>http://wilkinho.wordpress.com/2009/11/05/thinking-sphinx-cjk-support-experiment/</link>
		<comments>http://wilkinho.wordpress.com/2009/11/05/thinking-sphinx-cjk-support-experiment/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 13:41:49 +0000</pubDate>
		<dc:creator>Wilkin Ho</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rubyonrails]]></category>
		<category><![CDATA[sphinx]]></category>
		<category><![CDATA[thinking_sphinx]]></category>

		<guid isPermaLink="false">http://wilkinho.wordpress.com/?p=22</guid>
		<description><![CDATA[Currently in my rails project, solr and act_as_solr is used as the search engine of the app. As act_as_solr&#8217;s original author has stopped further development and the google group community seems inactive, I would like to try to look for alternatives. I tried to switch to sphinx and thinking_sphinx. I downloaded the source of sphinx [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wilkinho.wordpress.com&amp;blog=9682811&amp;post=22&amp;subd=wilkinho&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Currently in my rails project, <a href="http://lucene.apache.org/solr/">solr</a> and <a href="http://github.com/railsfreaks/acts_as_solr/">act_as_solr</a> is used as the search engine of the app. As act_as_solr&#8217;s original author has stopped further development and the google group community seems inactive, I would like to try to look for alternatives.</p>
<p>I tried to switch to <a href="http://www.sphinxsearch.com">sphinx</a> and <a href="http://freelancing-god.github.com/ts/en/">thinking_sphinx</a>. I downloaded the <a href="http://www.sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz">source</a> of sphinx 0.9.8.1 and built smoothly on my Mac development machine with snow leopard as my MySQL installation is not by Macports, or you can install sphinx directly from Macports. With the guidelines in thinking_sphinx website, everything goes fine. I installed the gem, added some codes in models, ran the rake tasks and I can start to search.</p>
<p>Then I need to deal with CJK support in my search. Parameters charset_table and ngram_char is need to be set in config file to facilitate this function. I found the charset table list in sphinx <a href="http://www.sphinxsearch.com/wiki/doku.php?id=charset_tables">wiki</a>. For charset_table, I combined the &#8220;common&#8221; list and &#8220;cjk&#8221; list, and it is a huge list. I spent sometime to add this list to the RAILS_ROOT/config/sphinx.yml file. The yml parser will throw &#8220;line too long&#8221; exception if I paste the list in a single line. I have the make the list in multiline, I tried to google around but the samples of other users just don&#8217;t work for me &#8211; the parser still can&#8217;t parse and throw exception. On the other hand, as thinking_sphinx generates a RAILS_ROOT/config/development.sphinx.conf file base on sphinx.yml, I have to make the list in multiline in the conf file too because sphinx cannot handle a too-long-line in conf file also. Finally, here is my current working sphinx.yml:</p>
<p><code>development:<br />
sql_range_step: 10000000 #handle fixture random id<br />
min_word_len: 1<br />
min_infix_len: 1<br />
ngram_len: 1<br />
enable_star: true<br />
ngram_chars: #...<br />
<span style="color:#ff0000;">charset_table:</span> "U+FF10..U+FF19-&gt;0..9, ..., 0..9, A..Z-&gt;a..z, a..z, <span style="color:#ff0000;">\\\n \</span><br />
U+F900-&gt;U+8C48, ..., U+F904-&gt;U+6ED1, <span style="color:#ff0000;">\\\n \</span><br />
#...<br />
U+AC00..U+D7A3, ..., U+A000..U+A48C, <span style="color:#ff0000;">\\\n \</span><br />
U+A492..U+A4C6"</code></p>
<h3>Testing</h3>
<p>Full width alphanumeric: works, use &#8220;ｈａｐｐｙ&#8221;, &#8220;２００９&#8221; can find &#8220;happy 2009&#8243;</p>
<p>Traditional &amp; Simplified Chinese: works, can search with single character/multi characters/single word/multi words</p>
<p>Korean: works, same as above</p>
<p>Japanese: partially work, sometimes fail to search with single kana character. For example, searching &#8220;あ&#8221; (a)/ &#8220;あい&#8221; (ai)/ &#8220;あいう&#8221; (aiu) cannot find &#8220;あいうえお&#8221; (aiueo) but search with &#8220;あいうえお&#8221; works. Searching &#8220;バカ&#8221; (BAKA) or &#8220;め&#8221; (me) can find &#8220;バカめ&#8221; (BAKAme) (Note: sorry for bad words&#8230;lol). Furthermore, this <a href="http://crunchytoast.com/2009/04/14/sphinx-search-in-japanese/">link</a> introduces charset table handling mapping of hiragana, katakana and half width katakana, which is useful in Japanese searching.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wilkinho.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wilkinho.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wilkinho.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wilkinho.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wilkinho.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wilkinho.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wilkinho.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wilkinho.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wilkinho.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wilkinho.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wilkinho.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wilkinho.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wilkinho.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wilkinho.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wilkinho.wordpress.com&amp;blog=9682811&amp;post=22&amp;subd=wilkinho&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wilkinho.wordpress.com/2009/11/05/thinking-sphinx-cjk-support-experiment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9f34689d92580c792722ff0fbd7d5e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wilkinho</media:title>
		</media:content>
	</item>
		<item>
		<title>Notes on ihower&#8217;s rails best practice presentation</title>
		<link>http://wilkinho.wordpress.com/2009/10/29/notes-on-ihowers-rails-best-practice-presentation/</link>
		<comments>http://wilkinho.wordpress.com/2009/10/29/notes-on-ihowers-rails-best-practice-presentation/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 16:06:30 +0000</pubDate>
		<dc:creator>Wilkin Ho</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rubyonrails]]></category>

		<guid isPermaLink="false">http://wilkinho.wordpress.com/?p=19</guid>
		<description><![CDATA[original Prologue Test your code Move code from Controller to Model Move finder to named_scope Use model association Use scope access Add model virtual attribute Use model callback Replace complex creation with factory method Move model logic into the model model.collection_model_ids (many-to-many) Nested model forms (one-to-one) &#8211; accepts_nested_attribute_for Nested model forms (one-to-many) &#8211; accepts_nested_attribute_for RESTful [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wilkinho.wordpress.com&amp;blog=9682811&amp;post=19&amp;subd=wilkinho&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://ihower.idv.tw/blog/archives/3075">original</a></p>
<p>Prologue</p>
<ol>
<li>Test your code</li>
</ol>
<p>Move code from Controller to Model</p>
<ol>
<li>Move finder to named_scope</li>
<li>Use model association</li>
<li>Use scope access</li>
<li>Add model virtual attribute</li>
<li>Use model callback</li>
<li>Replace complex creation with factory method</li>
<li>Move model logic into the model</li>
<li>model.collection_model_ids (many-to-many)</li>
<li>Nested model forms (one-to-one) &#8211; accepts_nested_attribute_for</li>
<li>Nested model forms (one-to-many) &#8211; accepts_nested_attribute_for</li>
</ol>
<p>RESTful</p>
<ol>
<li>Overuse route customization &#8211; map.resources &#8230;</li>
<li>Needless deep nesting</li>
<li>Do not use default route</li>
</ol>
<p>Model</p>
<ol>
<li>Keep finder in their own model</li>
<li>Love named_scope</li>
<li><a href="http://en.wikipedia.org/wiki/Law_of_Demeter">The Law of Demeter</a> (LoD) &#8211; delegate</li>
<li>DRY: metaprogramming</li>
<li>Extract into Module</li>
<li>Extract to composed class &#8211; composed_of</li>
<li>Use observer</li>
</ol>
<p>Migration</p>
<ol>
<li>Isolating seed data</li>
<li>Always add DB index</li>
</ol>
<p>Controller</p>
<ol>
<li>Use before_filter</li>
<li>DRY controller &#8211; <a href="http://github.com/josevalim/inherited_resources">InheritedResources</a></li>
</ol>
<p>View &#8211; &#8220;Never logic code in views&#8221;</p>
<ol>
<li>Move code to controller</li>
<li>Move code to model</li>
<li>Move code to helper</li>
<li>Replace instance variables with local variables &#8211; render :partial =&gt; &#8230;, :locals =&gt;&#8230;</li>
<li>Use form builder</li>
<li>Organize helper files</li>
<li>Learn rails helpers &#8211; content_for, yield, pass block parameter in helper</li>
</ol>
<p>Code Refactoring</p>
<ol>
<li>The book &#8211; &#8220;Refactoring Ruby Edition&#8221;</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wilkinho.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wilkinho.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wilkinho.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wilkinho.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wilkinho.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wilkinho.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wilkinho.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wilkinho.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wilkinho.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wilkinho.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wilkinho.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wilkinho.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wilkinho.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wilkinho.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wilkinho.wordpress.com&amp;blog=9682811&amp;post=19&amp;subd=wilkinho&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wilkinho.wordpress.com/2009/10/29/notes-on-ihowers-rails-best-practice-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9f34689d92580c792722ff0fbd7d5e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wilkinho</media:title>
		</media:content>
	</item>
		<item>
		<title>食字</title>
		<link>http://wilkinho.wordpress.com/2009/10/22/%e9%a3%9f%e5%ad%97/</link>
		<comments>http://wilkinho.wordpress.com/2009/10/22/%e9%a3%9f%e5%ad%97/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 12:59:48 +0000</pubDate>
		<dc:creator>Wilkin Ho</dc:creator>
				<category><![CDATA[隨筆]]></category>
		<category><![CDATA[食字]]></category>

		<guid isPermaLink="false">http://wilkinho.wordpress.com/?p=16</guid>
		<description><![CDATA[今天放工時看到一個的士車身廣告，是某銀行推廣一張以積分換取飛行里數的信用咭。它最顯眼的標語是這樣寫的：「飛　DXS Black Card莫屬」。無疑這又是一個食字的例子，一種近年被不同種類的媒體如傳媒或廣告等為了惹人注目而廣泛採用的文字把戲。但這次的食字有甚麼問題？問題可大了：食字食得把整句句子的意思癲倒了。很明顯，這句標語是把「非 DXS Black Card莫屬」這句雙重否定句中的「非」字食成「飛」字，表達「想飛行，非使用DXS Black Card不可」的意思，但沒有了非字的雙重否定句，不是變成了否定句了嗎？「DXS Black Card莫屬」，即是沒有DXS Black Card的份兒了。大家看到「飛　DXS Black Card莫屬」時，就明白到「想飛行，沒有DXS Black Card的份兒」了。 把雙重否定句扭曲成否定句，卻仍嘗試讓其保存原本意思的例子還有一個，就是最近幾年李克勤的某首歌的歌詞中，有一句「被你溫柔無微的照顧」。本來的「無微不至的照顧」，為了塞進兩個字的歌詞中，被人寫成「無微的照顧」了。結果，我就被你既「無」且「微」的照顧了。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wilkinho.wordpress.com&amp;blog=9682811&amp;post=16&amp;subd=wilkinho&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>今天放工時看到一個的士車身廣告，是某銀行推廣一張以積分換取飛行里數的信用咭。它最顯眼的標語是這樣寫的：「飛　DXS Black Card莫屬」。無疑這又是一個食字的例子，一種近年被不同種類的媒體如傳媒或廣告等為了惹人注目而廣泛採用的文字把戲。但這次的食字有甚麼問題？問題可大了：食字食得把整句句子的意思癲倒了。很明顯，這句標語是把「非 DXS Black Card莫屬」這句雙重否定句中的「非」字食成「飛」字，表達「想飛行，非使用DXS Black Card不可」的意思，但沒有了非字的雙重否定句，不是變成了否定句了嗎？「DXS Black Card莫屬」，即是沒有DXS Black Card的份兒了。大家看到「飛　DXS Black Card莫屬」時，就明白到「想飛行，沒有DXS Black Card的份兒」了。</p>
<p>把雙重否定句扭曲成否定句，卻仍嘗試讓其保存原本意思的例子還有一個，就是最近幾年李克勤的某首歌的歌詞中，有一句「被你溫柔無微的照顧」。本來的「無微不至的照顧」，為了塞進兩個字的歌詞中，被人寫成「無微的照顧」了。結果，我就被你既「無」且「微」的照顧了。</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wilkinho.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wilkinho.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wilkinho.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wilkinho.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wilkinho.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wilkinho.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wilkinho.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wilkinho.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wilkinho.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wilkinho.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wilkinho.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wilkinho.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wilkinho.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wilkinho.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wilkinho.wordpress.com&amp;blog=9682811&amp;post=16&amp;subd=wilkinho&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wilkinho.wordpress.com/2009/10/22/%e9%a3%9f%e5%ad%97/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9f34689d92580c792722ff0fbd7d5e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wilkinho</media:title>
		</media:content>
	</item>
		<item>
		<title>Install Git on ubuntu hardy</title>
		<link>http://wilkinho.wordpress.com/2009/04/06/install-git-on-ubuntu-hardy/</link>
		<comments>http://wilkinho.wordpress.com/2009/04/06/install-git-on-ubuntu-hardy/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 04:02:36 +0000</pubDate>
		<dc:creator>Wilkin Ho</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.wilkinho.com/?p=11</guid>
		<description><![CDATA[On the last weekend I tried to install the latest version of Git on my ubuntu hardy machine, but failed. This morning I googled again and follow this guideline to make it work.  Remove old version of Git: sudo apt-get remove git-core Install prerequisites: sudo apt-get install curl libcurl4-openssl-dev gettext Fetch, unpack and build: wget http://kernel.org/pub/software/scm/git/git-1.6.2.2.tar.gz [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wilkinho.wordpress.com&amp;blog=9682811&amp;post=11&amp;subd=wilkinho&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>On the last weekend I tried to install the latest version of <a title="Git" href="http://git-scm.com/" target="_self">Git</a> on my ubuntu hardy machine, but failed. This morning I googled again and follow this <a href="http://scottschulz.us/2008/06/07/ubuntu-hardy-the-10-minute-git-install/" target="_self">guideline</a> to make it work. </p>
<p>Remove old version of Git:<br />
<code><br />
sudo apt-get remove git-core<br />
</code><br />
Install prerequisites:<br />
<code><br />
sudo apt-get install curl libcurl4-openssl-dev gettext<br />
</code><br />
Fetch, unpack and build:<br />
<code><br />
wget http://kernel.org/pub/software/scm/git/git-1.6.2.2.tar.gz<br />
</code></p>
<p><code>tar zvxf git-1.6.2.2.tar</code></p>
<p><code>cd git-1.6.2.2</code></p>
<p><code>make prefix=/usr all</code></p>
<p><code>sudo make prefix=/usr install</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wilkinho.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wilkinho.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wilkinho.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wilkinho.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wilkinho.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wilkinho.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wilkinho.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wilkinho.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wilkinho.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wilkinho.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wilkinho.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wilkinho.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wilkinho.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wilkinho.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wilkinho.wordpress.com&amp;blog=9682811&amp;post=11&amp;subd=wilkinho&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wilkinho.wordpress.com/2009/04/06/install-git-on-ubuntu-hardy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9f34689d92580c792722ff0fbd7d5e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wilkinho</media:title>
		</media:content>
	</item>
		<item>
		<title>Head First Design Patterns study notes</title>
		<link>http://wilkinho.wordpress.com/2009/03/06/head-first-design-patterns-study-notes/</link>
		<comments>http://wilkinho.wordpress.com/2009/03/06/head-first-design-patterns-study-notes/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 02:53:53 +0000</pubDate>
		<dc:creator>Wilkin Ho</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[design pattern]]></category>

		<guid isPermaLink="false">http://blog.wilkinho.com/?p=5</guid>
		<description><![CDATA[OO Basics Abstraction Encapsulation Polymorphism Inheritance OO Principles Encapsulate what varies. Favor composition over inheritance. Program to interfaces, not implementations. Strive for loosely coupled designs between objects that interact. Classes should be open for extension but closed for modification. Depend on abstractions. Do not depend on concrete classes. Only talk to your friends. Don&#8217;t call [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wilkinho.wordpress.com&amp;blog=9682811&amp;post=14&amp;subd=wilkinho&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>OO Basics</strong></p>
<ul>
<li>Abstraction</li>
<li>Encapsulation</li>
<li>Polymorphism</li>
<li>Inheritance</li>
</ul>
<p><strong>OO Principles</strong></p>
<ul>
<li>Encapsulate what varies.</li>
<li>Favor composition over inheritance.</li>
<li>Program to interfaces, not implementations.</li>
<li>Strive for loosely coupled designs between objects that interact.</li>
<li>Classes should be open for extension but closed for modification.</li>
<li>Depend on abstractions. Do not depend on concrete classes.</li>
<li>Only talk to your friends.</li>
<li>Don&#8217;t call us, we&#8217;ll call you.</li>
<li>A class should have only one reason to change.</li>
</ul>
<p><strong>OO Patterns</strong></p>
<ul>
<li><strong>Strategy </strong>- defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.</li>
<li><strong>Observer </strong>- defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.</li>
<li><strong>Decorator </strong>- Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.</li>
<li><strong>Abstract Factory </strong>- Provide an interface for creating families of related or dependent objects without specifying their concrete classes.</li>
<li><strong>Factory Method </strong>- Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to the subclasses.</li>
<li><strong>Singleton </strong>- Ensure a class only has one instance and provide a global point of access to it.</li>
<li><strong>Command </strong>- Encapsulates a request as an object, thereby letting you parameterize clients with different requests, and support undoable operations.</li>
<li><strong>Adapter </strong>- Converts the interface of a class into another interface clients expect. Lets classes work together that couldn&#8217;t otherwise because of incompatible interfaces.</li>
<li><strong>Facade </strong>- Provides a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.</li>
<li><strong>Template Method </strong>- Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm&#8217;s structure.</li>
<li><strong>Iterator </strong>- Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.</li>
<li><strong>Composite </strong>- Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.</li>
<li><strong>State </strong>- Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.</li>
<li><strong>Proxy </strong>- Provide a surrogate or placeholder for another object to control access of it.
<ul>
<li>Remote Proxy manages interaction between a client and a remote object.</li>
<li>Virtual Proxy controls access to an object that is expensive to instantiate.</li>
<li>Protection Proxy controls access to the methods of an object based on the caller.</li>
</ul>
</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/wilkinho.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/wilkinho.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/wilkinho.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/wilkinho.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/wilkinho.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/wilkinho.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/wilkinho.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/wilkinho.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/wilkinho.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/wilkinho.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/wilkinho.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/wilkinho.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/wilkinho.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/wilkinho.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=wilkinho.wordpress.com&amp;blog=9682811&amp;post=14&amp;subd=wilkinho&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://wilkinho.wordpress.com/2009/03/06/head-first-design-patterns-study-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9f34689d92580c792722ff0fbd7d5e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wilkinho</media:title>
		</media:content>
	</item>
	</channel>
</rss>
