<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<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">
	<channel>
		<title>冒号论坛 &#187; Tag: algorithm - Recent Topics</title>
		<link>http://bbs.zhenghui.org/tags/algorithm</link>
		<description>冒号论坛 &raquo; Tag: algorithm - Recent Topics</description>
		<language>en-US</language>
		<pubDate>Wed, 08 Feb 2012 23:50:56 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://bbs.zhenghui.org/search.php</link>
		</textInput>
		<atom:link href="http://bbs.zhenghui.org/rss/tags/algorithm/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>Todd on "算法设计需要什么样的思维？"</title>
			<link>http://bbs.zhenghui.org/topic/%e7%ae%97%e6%b3%95%e8%ae%be%e8%ae%a1%e9%9c%80%e8%a6%81%e4%bb%80%e4%b9%88%e6%a0%b7%e7%9a%84%e6%80%9d%e7%bb%b4%ef%bc%9f#post-128</link>
			<pubDate>Sun, 13 Jun 2010 17:29:21 +0000</pubDate>
			<dc:creator>Todd</dc:creator>
			<guid isPermaLink="false">128@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;如果说软件设计中最重要的是抽象思维，那么算法设计需要什么样的思维呢？
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>Todd on "成员方法的疑问"</title>
			<link>http://bbs.zhenghui.org/topic/%e6%88%90%e5%91%98%e6%96%b9%e6%b3%95%e7%9a%84%e7%96%91%e9%97%ae#post-73</link>
			<pubDate>Tue, 02 Mar 2010 22:09:24 +0000</pubDate>
			<dc:creator>Todd</dc:creator>
			<guid isPermaLink="false">73@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;OOP是以数据为中心组织算法的。OOP把面向过程的函数变成了类的成员方法的过程，也是过程抽象到数据抽象的转变过程。但我发现，即使在OOP中过程抽象似乎还有存在的意义，特别是，我常对成员方法的设计还是有感觉拿不准的地方。比如：&#60;/p&#62;
&#60;p&#62;1.STL中的算法多是作为函数提供的，没有作为容器类的成员方法。对于这个问题，我觉得STL的设计有它的合理的一面：因为sort，transform等算法本身也是一种被人所熟知的概念，它的独立存在是对概念的直接表达；独立性也增强了算法的普适性。但这样的设计也有缺点：对象的行为不够饱满；用户不仅需要获取对象，还需要依赖额外的算法，没有达到数据抽象的高内聚效果。了解mixin以后，我觉得也许mixin是解决这个问题的更好方法：既保持算法的独立性；又可以方便地混入对象达到数据对算法的吸附作用。&#60;/p&#62;
&#60;p&#62;2.对于存在交互情况，比如：画笔在画纸上作画，我觉得不管是paper.draw(pen)还是pen.draw(paper)都不如用函数表达为draw(paper,pen)来得自然。据我所知，这种情况在建模中常抽象为一种服务来表达某一功能，比如：DrawService。&#60;/p&#62;
&#60;p&#62;请问有没有一个比较好的方法来分析算法什么情况下适合设计为类的成员方法呢？什么情况下又应该作为独立的函数(C++)或者是抽象为服务呢？
&#60;/p&#62;
</description>
		</item>

	</channel>
</rss>

