<?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: open closed principle</title>
		<link>http://bbs.zhenghui.org/topic/open-closed-principle</link>
		<description>冒号论坛 &raquo; Topic: open closed principle</description>
		<language>en-US</language>
		<pubDate>Thu, 09 Feb 2012 00:07: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/open-closed-principle" rel="self" type="application/rss+xml" />

		<item>
			<title>hui on "open closed principle"</title>
			<link>http://bbs.zhenghui.org/topic/open-closed-principle#post-25</link>
			<pubDate>Sun, 10 Jan 2010 13:51:10 +0000</pubDate>
			<dc:creator>hui</dc:creator>
			<guid isPermaLink="false">25@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;数学中最常见的（但不限于）closed是指：一个集合中某种运算是封闭的,即集合中任意一个或多个元素经过该运算后仍然属于该集合，也称闭包（closure）原则。例如，整数对加法、减法、乘法封闭，对除法不封闭（比如：3/2不属于整数）。&#60;br /&#62;
OCP中的closed主要是指“固定不变”、“不容修改”的意思。&#60;br /&#62;
二者不能说完全没有联系——都有“封闭”的涵义，但总的说来区别大于联系。
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>Todd on "open closed principle"</title>
			<link>http://bbs.zhenghui.org/topic/open-closed-principle#post-24</link>
			<pubDate>Sun, 10 Jan 2010 13:26:23 +0000</pubDate>
			<dc:creator>Todd</dc:creator>
			<guid isPermaLink="false">24@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;这里的closed的概念和数学中的封闭系统(closed system)是否有联系？
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>hui on "open closed principle"</title>
			<link>http://bbs.zhenghui.org/topic/open-closed-principle#post-23</link>
			<pubDate>Sun, 10 Jan 2010 12:55:02 +0000</pubDate>
			<dc:creator>hui</dc:creator>
			<guid isPermaLink="false">23@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;首先，Meyer提出的OCP是指模块分解的原则，并不限于类级别的模块。&#60;br /&#62;
其次，当时他提出的OCP其实已经涵盖了实现继承和接口继承。&#60;br /&#62;
下面稍微具体地说一下。&#60;br /&#62;
所谓open是指模块可以扩展（extension），这个容易理解。&#60;br /&#62;
所谓closed是指能为其他模块所用，这包括两方面：一是设计层或规范层——模块有定义良好的（well-defined)、稳定的规范描述，并作为正式的标准被认可和接受；二是实现层——模块可以作为编译单位，并被客户使用（比如作为library）。&#60;/p&#62;
&#60;p&#62;当然，Meyer在他的著作《Object Oriented Software Construction》中提到的继承的确主要是实现继承，那时似乎还没有明确的接口继承概念。&#60;/p&#62;
&#60;p&#62;最后，重申《冒号课堂》中强调的观点：提倡接口继承，避免实现继承。
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>Todd on "open closed principle"</title>
			<link>http://bbs.zhenghui.org/topic/open-closed-principle#post-22</link>
			<pubDate>Sun, 10 Jan 2010 12:08:07 +0000</pubDate>
			<dc:creator>Todd</dc:creator>
			<guid isPermaLink="false">22@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;OCP有两个版本，一个是Meyer最初提出的关于实现继承的，另一个是现在比较流行的关于接口继承的。前者关注的是实现的稳定(closed)与扩展(open)；后者关注的是规范的稳定(closed)与扩展(open)。不知道理解对不对？
&#60;/p&#62;
</description>
		</item>

	</channel>
</rss>

