.NET组件程序设计

在本书中,一个组件是一个.NET类
一个对象是一个类的实例。对象有时候也被称作服务器
注意书中经常会交替使用对象以及服务器来指代组件

P2(-2)为了证明这个道理,我会描绘:在我的设计图中出现的组件的入口点使用接口优于公共方法。
原文:To emphasize this practice, I represent the entry points of the components that appear in my design diagrams as interfaces rather than mere public methods.
建议:为了强调这一(最佳)实践,在设计图中我用接口而不是单纯的公共方法来表示组件的入口点。

P5(15)例如,改变成员变量值会有什么边际影响,对基类中的代码会造成什么影响,重载一个基类方法并提供一个不同的行为是否会破坏那些预期基类行为的客户端代码?
原文:For example, what is the side effect of changing the value of a member variable? How does it affect the code in the base class? Will overriding a base class method and providing a different behavior break the code of clients that expect the base behavior?
建议:"边际影响"译为"副作用"较好,"重载"应该为"覆盖"或"重写",在派生类中添加overload不会break原来的code,如果是override基类方法,则另当别论。

P6(8)面向组件编程要求具有支持那些坚持其核心原则的开发方法和开发人员的系统。
原文:Component-oriented programming requires both systems that support the approach and programmers that adhere to its discipline and its core principles.
建议:面向组件编程既需要支持该方法的系统,也需要那些恪守其核心原则的开发人员。

P7(7)为了实现组件内接口定义的功能,您可以使用传统的面向对象技术,但通常最终类的层次关系应该更加简单和易于管理。
原文:To implement the functionality promised by an interface inside a component, you use traditional object-oriented methodologies, but the resulting class hierarchies are usually simpler and easier to manage.
建议:为了实现组件内接口定义的功能,您可以使用传统的面向对象技术,而这样得到的类的层次关系通常会更加简单和易于管理。
这里主要是跟纯粹的面向对象编程相比,阐述了首先使用面向组件技术,在于组件内部的实现中使用面向对象技术,这样得到的类的层次关系会更加简单。

P11(17)你能够选择重载其默认行为以实现。。。
原文:You can choose to override its default behavior to meet some advanced need or to provide your own custom version control policy, but in doing so you risk creating DLL Hell.
评论:还是把override 翻译为"重载"。。。我晕。。。

posted on 2007-07-20 23:32  融化了的朱古力  阅读(676)  评论(1编辑  收藏  举报

导航