<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: 应用工厂模式解决实际问题</title>
	<atom:link href="http://wutiam.net/2009/03/use-factory-pattern-to-solve-problem/feed/" rel="self" type="application/rss+xml" />
	<link>http://wutiam.net/2009/03/use-factory-pattern-to-solve-problem/</link>
	<description>I&#039;m islet8, I&#039;m what I am</description>
	<lastBuildDate>Fri, 27 Jan 2012 07:00:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: islet8</title>
		<link>http://wutiam.net/2009/03/use-factory-pattern-to-solve-problem/comment-page-1/#comment-3019</link>
		<dc:creator>islet8</dc:creator>
		<pubDate>Fri, 03 Sep 2010 04:32:43 +0000</pubDate>
		<guid isPermaLink="false">http://wutiam.net/?p=84#comment-3019</guid>
		<description>&lt;a href=&quot;#comment-3002&quot; rel=&quot;nofollow&quot;&gt;@ Dbger&lt;/a&gt; 
嗯，由每个子类自己向工程注册，比由工厂统一为各子类注册更灵活一些，不过还是需要和子类约定“必须调一次注册”的规则，尤其是当代码要提供给第三方使用时</description>
		<content:encoded><![CDATA[<p><a href="#comment-3002" rel="nofollow">@ Dbger</a><br />
嗯，由每个子类自己向工程注册，比由工厂统一为各子类注册更灵活一些，不过还是需要和子类约定“必须调一次注册”的规则，尤其是当代码要提供给第三方使用时</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dbger</title>
		<link>http://wutiam.net/2009/03/use-factory-pattern-to-solve-problem/comment-page-1/#comment-3002</link>
		<dc:creator>Dbger</dc:creator>
		<pubDate>Thu, 02 Sep 2010 10:18:55 +0000</pubDate>
		<guid isPermaLink="false">http://wutiam.net/?p=84#comment-3002</guid>
		<description>好文章！

注册命令可以利用一个静态变量构造函数来做：
class CmdRegister
{
public:
    CmdRegister(const string&amp; cmdName, CreateCmdInstanceFunc createFunc)
   {
        CommandFactory::GetInstance()-&gt;RegCommand(cmdName, createFunc);
   }
}

#define REG_CMD(arg1, arg2) \
static CmdRegister _cmdRegister(arg1, arg2);

当然，这个其实还是在运行时做的。</description>
		<content:encoded><![CDATA[<p>好文章！</p>
<p>注册命令可以利用一个静态变量构造函数来做：<br />
class CmdRegister<br />
{<br />
public:<br />
    CmdRegister(const string&amp; cmdName, CreateCmdInstanceFunc createFunc)<br />
   {<br />
        CommandFactory::GetInstance()-&gt;RegCommand(cmdName, createFunc);<br />
   }<br />
}</p>
<p>#define REG_CMD(arg1, arg2) \<br />
static CmdRegister _cmdRegister(arg1, arg2);</p>
<p>当然，这个其实还是在运行时做的。</p>
]]></content:encoded>
	</item>
</channel>
</rss>

