<?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: inheritance - Recent Topics</title>
		<link>http://bbs.zhenghui.org/tags/inheritance</link>
		<description>冒号论坛 &raquo; Tag: inheritance - Recent Topics</description>
		<language>en-US</language>
		<pubDate>Wed, 08 Feb 2012 23:57:09 +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/inheritance/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>folger on "关于继承"</title>
			<link>http://bbs.zhenghui.org/topic/%e5%85%b3%e4%ba%8e%e7%bb%a7%e6%89%bf#post-316</link>
			<pubDate>Tue, 10 May 2011 18:22:31 +0000</pubDate>
			<dc:creator>folger</dc:creator>
			<guid isPermaLink="false">316@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;有个小问题,请老师指教.&#60;/p&#62;
&#60;p&#62;在第九章讲继承时,您有这么一个观点,父类应该尽可能禁用protected域成员.我想知道什么情况下可以违背这一原则.因为现实中这种情况似乎非常普遍:父类中含有需要和子类共享而又不便为外界所知的数据,这时候难道不是将其设为protected更为合适吗?
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>Todd on "实现继承问题的经典实例"</title>
			<link>http://bbs.zhenghui.org/topic/%e5%ae%9e%e7%8e%b0%e7%bb%a7%e6%89%bf%e9%97%ae%e9%a2%98%e7%9a%84%e7%bb%8f%e5%85%b8%e5%ae%9e%e4%be%8b#post-274</link>
			<pubDate>Mon, 03 Jan 2011 16:46:05 +0000</pubDate>
			<dc:creator>Todd</dc:creator>
			<guid isPermaLink="false">274@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;&#34;You must override hashCode() in every class that overrides equals(). Failure to do so will result in a violation of the general contract for Object.hashCode(), which will prevent your class from functioning properly in conjunction with all hash-based collections, including HashMap, HashSet, and Hashtable.&#34;&#60;br /&#62;
-- from Effective Java, by Joshua Bloch&#60;/p&#62;
&#60;p&#62;《冒号课堂》中提到了实现继承的诸多问题，必须引起重视，解决的方法其中之一便是将这类实现相关的“潜规则”明确写入文档。我觉得最经典的实例就是Java中覆盖equals()方法必须同时覆盖hashCode()的问题。
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>Todd on "subtype和subclass"</title>
			<link>http://bbs.zhenghui.org/topic/subtype%e5%92%8csubclass#post-130</link>
			<pubDate>Mon, 14 Jun 2010 00:13:36 +0000</pubDate>
			<dc:creator>Todd</dc:creator>
			<guid isPermaLink="false">130@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;虽然subtype和subclass是OOP中最基本的问题之一，但我是在读《冒号课堂》的时候才开始注意到这个问题。我想国内的程序员不能区分subtype和subclass的不在少数。下面这个资料对于subtype和subclass讨论得比较深入，贴上来分享：&#60;/p&#62;
&#60;p&#62;http://www.cs.princeton.edu/courses/archive/fall98/cs441/mainus/mainus.html
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>Todd on "另类继承"</title>
			<link>http://bbs.zhenghui.org/topic/%e5%8f%a6%e7%b1%bb%e7%bb%a7%e6%89%bf#post-52</link>
			<pubDate>Sat, 20 Feb 2010 21:31:36 +0000</pubDate>
			<dc:creator>Todd</dc:creator>
			<guid isPermaLink="false">52@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;书中继承机制部分介绍了实现继承和接口继承，但感觉还有另一种继承的用法可以说的。比如boost::nocopyable就是利用了C++基类的私有拷贝构造函数防止派生类的拷贝构造。我觉得这类用法既不属于实现继承也不属于接口继承，只是利用了继承配合特定的语言特性达到目的。&#60;/p&#62;
&#60;p&#62;这也许已经不属于OOP理论范畴，而是与具体语言相关的一些技巧，所以我将这类用法归为实现继承、接口继承之外也另类继承。
&#60;/p&#62;
</description>
		</item>

	</channel>
</rss>

