Which properties of a module should be public, and which ones secret? As a general guideline, the public part should include the specification of the module’s functionality; anything that relates to the implementation of that functionality should be kept secret, so as to preserve other modules from later reversals of implementation decisions.
一个模块中哪些属性应该是公共的,哪些是秘密的?作为一个通用的方法,公共部份应该包括模块的功能性规格;任何与功能性实现有关的应该被保持为秘密的,这样保护了其它模块不会受到以后实现变化的影响.
This first answer is still fairly vague, however, as it does not tell us what is the specification and what is the implementation; in fact, one might be tempted to reverse the definition by stating that the specification consists of whatever public properties the module has, and the implementation of its secrets! The object-oriented approach will give us a much more precise guideline thanks to the theory of abstract data types.
然而,这最初的答案仍然是相当的模糊,它不能告诉我们什么是规格,什么是实现;事实上,规格由模块的任何公共特性和秘密实现所组成的,这样的描述可能试图颠倒定义!由于抽象的数据类型理论,面向对象的方式将会给我们一个更加精确的引导.