<?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; Topic: 抽象机制</title>
		<link>http://bbs.zhenghui.org/topic/%e6%8a%bd%e8%b1%a1%e6%9c%ba%e5%88%b6</link>
		<description>冒号论坛 &raquo; Topic: 抽象机制</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 12:40:23 +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/topic/%e6%8a%bd%e8%b1%a1%e6%9c%ba%e5%88%b6" rel="self" type="application/rss+xml" />

		<item>
			<title>Lumj on "抽象机制"</title>
			<link>http://bbs.zhenghui.org/topic/%e6%8a%bd%e8%b1%a1%e6%9c%ba%e5%88%b6#post-325</link>
			<pubDate>Thu, 09 Jun 2011 19:50:35 +0000</pubDate>
			<dc:creator>Lumj</dc:creator>
			<guid isPermaLink="false">325@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;我看了您推荐的读物,不得不说我仍然认为将迭代抽象与其它4者相提并论欠妥..&#60;br /&#62;
就好比..我们不会给书增加一个新的章节,叫'IO抽象',然后给出文件流抽象之类的例子,并配以&#34;IO抽象使得程序员不必关心诸如缓冲之类的事,只需与逻辑上的Stream打交道&#34;之类的陈述
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>folger on "抽象机制"</title>
			<link>http://bbs.zhenghui.org/topic/%e6%8a%bd%e8%b1%a1%e6%9c%ba%e5%88%b6#post-324</link>
			<pubDate>Mon, 06 Jun 2011 17:43:46 +0000</pubDate>
			<dc:creator>folger</dc:creator>
			<guid isPermaLink="false">324@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;同感,迭代更像是其他抽象的一个应用,先看看上面的资料...
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>Lumj on "抽象机制"</title>
			<link>http://bbs.zhenghui.org/topic/%e6%8a%bd%e8%b1%a1%e6%9c%ba%e5%88%b6#post-307</link>
			<pubDate>Sat, 26 Mar 2011 23:34:55 +0000</pubDate>
			<dc:creator>Lumj</dc:creator>
			<guid isPermaLink="false">307@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;好的,最近一次21世纪计算大会,她是演讲人之一,我当时不识泰山,只觉得她的话题很有感(她谈的就是abstraction),后来才知道就是她的Liskov principle
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>hui on "抽象机制"</title>
			<link>http://bbs.zhenghui.org/topic/%e6%8a%bd%e8%b1%a1%e6%9c%ba%e5%88%b6#post-305</link>
			<pubDate>Sat, 26 Mar 2011 23:08:35 +0000</pubDate>
			<dc:creator>hui</dc:creator>
			<guid isPermaLink="false">305@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;Lumj: 建议你看看图灵奖获得者Barbara Liskov（就是那位提出Liskov原则的女士）的书《Program Development in Java: Abstraction, Specification, and Object-Oriented Design》 ，该书第六章专门谈到迭代抽象。无论java是否为你的熟悉或喜欢的语言，这本书都值得看。&#60;br /&#62;
另外，《冒号课堂》每节后面都有参考资料，可进行延伸阅读。
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>Lumj on "抽象机制"</title>
			<link>http://bbs.zhenghui.org/topic/%e6%8a%bd%e8%b1%a1%e6%9c%ba%e5%88%b6#post-303</link>
			<pubDate>Sat, 26 Mar 2011 11:10:39 +0000</pubDate>
			<dc:creator>Lumj</dc:creator>
			<guid isPermaLink="false">303@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;冒号老师,其实我读到这里的时候,感觉'迭代抽象'出现在其它那4者中间不太合适,因为那4个抽象是..怎么说呢..'编程模型'层面的,而'迭代'却是程序功能层面的,我感觉不应该放在一起讨论
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>hui on "抽象机制"</title>
			<link>http://bbs.zhenghui.org/topic/%e6%8a%bd%e8%b1%a1%e6%9c%ba%e5%88%b6#post-50</link>
			<pubDate>Mon, 15 Feb 2010 18:27:26 +0000</pubDate>
			<dc:creator>hui</dc:creator>
			<guid isPermaLink="false">50@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;Java在开始引入foreach时遭到一些非议，认为是无多大用处的语法糖。不过只要能让代码更简洁、可读性更高、更不容易出bug，便是语法糖又何妨？何况这样的用法的确提高了抽象的层次，让同样的表达适用于更多的underlying容器（甚至包括最基本的数组），对底层变化的适应力更强。
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>Todd on "抽象机制"</title>
			<link>http://bbs.zhenghui.org/topic/%e6%8a%bd%e8%b1%a1%e6%9c%ba%e5%88%b6#post-49</link>
			<pubDate>Mon, 15 Feb 2010 12:13:53 +0000</pubDate>
			<dc:creator>Todd</dc:creator>
			<guid isPermaLink="false">49@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;更明白了，谢谢！&#60;/p&#62;
&#60;p&#62;关于迭代抽象，我最早习惯C的for(int i; i &#38;lt; n; i++)，但有时不小心就会出现死循环，而foreach不存在死循环问题，所以逐渐开始用后者了。这也印证了抽象层次越高越普适越可靠。
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>hui on "抽象机制"</title>
			<link>http://bbs.zhenghui.org/topic/%e6%8a%bd%e8%b1%a1%e6%9c%ba%e5%88%b6#post-48</link>
			<pubDate>Sat, 13 Feb 2010 16:05:51 +0000</pubDate>
			<dc:creator>hui</dc:creator>
			<guid isPermaLink="false">48@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;&#60;em&#62;过程抽象&#60;/em&#62;赋予程序员自定义函数或运算的能力。参数抽象和规范抽象在其中的体现应该是明显的，以开方函数sqrt(double number)为例:&#60;br /&#62;
number可以是任何一个非负double型变量，这是参数抽象；调用者不必关心sqrt的实现，只根据它的规范便确信sqrt(a)将保证返回a的一个平方根，这是规范抽象。&#60;/p&#62;
&#60;p&#62;&#60;em&#62;数据抽象&#60;/em&#62;赋予程序员自定义数据类型的能力。参数抽象和规范抽象在其中的体现与过程抽象是类似的。&#60;em&#62;类型层级&#60;/em&#62;和&#60;em&#62;多态抽象&#60;/em&#62;则是在数据抽象的基础上融入了类族和多态的因素。&#60;/p&#62;
&#60;p&#62;&#60;em&#62;迭代抽象&#60;/em&#62;赋予程序员自定义循环的能力。在没有迭代抽象时，程序员如果需要遍历一个容器，需要关注不少的细节：如何获取容器的元素？何处是起点？何处是终点？遍历的方式（顺序、倒序、随机、跳跃）？这不仅增加了客户的负担，也限制了容器今后的变化（担心影响到客户）。&#60;br /&#62;
以Java的Iterator为例：&#60;br /&#62;
public interface Iterator&#38;lt;E&#38;gt;{&#60;br /&#62;
    boolean hasNext(); // Returns true if the iteration has more elements.&#60;br /&#62;
    E next();          // Returns the next element in the iteration.&#60;br /&#62;
    void remove();     // Removes from the underlying collection the last element&#60;br /&#62;
}&#60;br /&#62;
要遍历一个容器，只需要获取它的一个Iterator对象即可。在这里，Iterator便是一个&#60;strong&#62;规范抽象&#60;/strong&#62;，其规范体现在hasNext、next和remove的文档描述上。&#60;br /&#62;
更简单地，只要容器实现了Iterable接口，便可采用for-each循环：&#60;br /&#62;
for (ElementType element : elements) process(element);&#60;br /&#62;
在这里，连hasNext和next的调用都被隐去了，可以认为抽象得到了进一步的提升，此时迭代已经上升到了语言层面（借鉴了C#语法）。
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>Todd on "抽象机制"</title>
			<link>http://bbs.zhenghui.org/topic/%e6%8a%bd%e8%b1%a1%e6%9c%ba%e5%88%b6#post-47</link>
			<pubDate>Fri, 12 Feb 2010 19:31:13 +0000</pubDate>
			<dc:creator>Todd</dc:creator>
			<guid isPermaLink="false">47@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;第7课P186讲到：借助这两种抽象机制（参数抽象和规范抽象），我们可以实现五类基本抽象：过程抽象、数据抽象、迭代抽象、类型层级、多态抽象。&#60;/p&#62;
&#60;p&#62;还不是很明白这两种抽象机制与五类基本抽象的关系。比如：迭代抽象如何体现了参数抽象和规范抽象。
&#60;/p&#62;
</description>
		</item>

	</channel>
</rss>

