{$cfg_webname}
主页 > 外文翻译 > 计算机翻译 >

Java的隐藏实现

来源:56doc.com  资料编号:5D12672 资料等级:★★★★★ %E8%B5%84%E6%96%99%E7%BC%96%E5%8F%B7%EF%BC%9A5D12672
资料以网页介绍的为准,下载后不会有水印.资料仅供学习参考之用. 帮助
资料介绍

英文翻译
Java的隐藏实现(中文3400字,英文2500字)
    在面向对象的设计中,最关键的问题就是“将会变和不会变的东西分离开来。”这一点对类库尤为重要。类库的使用者(客户程序员)应该能完全仰赖类库,他们知道,即使类库出了新版本,他们也不必重写代码。另一方面,类库的创建者也应该可以在确保不影响客户程序员代码的前提下,保留对 类库作修正和改进的权利。
要达到上述目的,可以使用约定。比方说,类库的开发人员必须遵守:修改类的时候不删除现有的方法,因为这可能会影响客户程序员的代码。但是还有一些更棘手的问题。就拿成员数据来说,类库的开发人员又怎么知道客户程序员会使用哪些数据呢?对于那些只与类的内部实现有关的,不应该让客户程序员使用的方法来说,情况也一样。

英文原文
Bruce Eckel. Thinking in Java, 2nd edition(part). America: electronic books
Hiding the Implementation
A primary consideration in object-oriented design is “separating the things that change from the things that stay the same.”
This is particularly important for libraries. Users (client programmers) of that library must be able to rely on the part they use, and know that they won’t need to rewrite code if a new version of the library comes out. On the flip side, the library creator must have the freedom to make modifications and improvements with the certainty that the client code won’t be affected by those changes.

推荐资料