<?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/"
	>

<channel>
	<title>Totodo&#039;s blog &#187; 设计模式</title>
	<atom:link href="http://blog.totodo.com/archives/tag/%e8%ae%be%e8%ae%a1%e6%a8%a1%e5%bc%8f/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.totodo.com</link>
	<description>revolution~</description>
	<lastBuildDate>Sun, 15 Jan 2012 05:46:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ExtJS 设计模式 之一 :单例（singleton）</title>
		<link>http://blog.totodo.com/archives/79</link>
		<comments>http://blog.totodo.com/archives/79#comments</comments>
		<pubDate>Sat, 29 Dec 2007 06:37:56 +0000</pubDate>
		<dc:creator>totodo</dc:creator>
				<category><![CDATA[Extjs]]></category>
		<category><![CDATA[软件技师]]></category>
		<category><![CDATA[设计模式]]></category>
		<category><![CDATA[singleton]]></category>

		<guid isPermaLink="false">http://blog.totodo.com/2007/12/29/extjs-%e8%ae%be%e8%ae%a1%e6%a8%a1%e5%bc%8f-%e4%b9%8b%e4%b8%80-%e5%8d%95%e4%be%8b%ef%bc%88singleton%ef%bc%89/</guid>
		<description><![CDATA[ExtJS 设计模式 之一 （单例）     Extjs 发展至今，传承了YUI的伟大精髓， YUI得到了Douglas Crockford（任职于 Yahoo! 的一名 JavaScript 传道者和架构师，他是全球最有造诣的 JavaScript 语言专家之一，Blog：http://www.crockford.com/) 大师的赞同,而ExtJS也是将YUI的模式脚本编程学习使用的淋漓尽致，并且还给它做了几套华丽的CSS嫁衣&#8230;.,   而在ExtJS越发耀眼的同时，我等初学者在使用ExtJs的时候也是晕呼其呼。（好在2.0 推出之后，官方的文档，像雨后春笋一样，开始覆盖到方方面面。）     其实，拨开ExtJS华丽的外衣，翻阅其体内精致的代码，不难发现一些我们耳熟能详的设计模式。     在早期1.0，1.1的好多例子中，我们会看到这样风格的代码。 咂一看，不是我们能理解的方式， function(){}(), 是何意？。 //()在这里，意味着方法已经执行，并且return里面的已经产生， 这样可能很难理解，那等同与执行 function oo(){}，这样是否好理解些了？ BTW :这里要引入JavaScript的一个高级概念，“闭包”。(具体内容参考《JavaScript The Definitve Guid,5th Eddion》Section 8.8 &#8211;Function Scope and Closures ,也是被Douglas Crockford推荐的为数不多的两本书籍之一。), 当然不急着去翻，先把我的废话看完。     好了，看这种使用别扭的使用方式， 而这种方式，在我们的页面，或者其他类中， 调用Oo的a方法的时候，形式如下 对，正是这样的一种JS编程方式，被Douglas Crockford作为JS的一种单例的实现， 大师还把它叫做“Module Pattern”,     好，如果我们不用所谓单例呢？， 就看看传统的对象方式，同学们肯定在Pototype盛行的时代，已经弄的一清二楚。     [...]]]></description>
		<wfw:commentRss>http://blog.totodo.com/archives/79/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

