Object-Oriented Design Heuristics 笔记(1)

    我是从csdn的一个Blog里知道这本书的,下来一看,很奇怪的书名,很通俗的文风。今天读了Chapter1-2,觉得 Arthur J. Riel他老人家说得很有道理,除此之外没有再多的感想了--可能是我缺乏OOD经验吧--只好把Chapter2的Summary摘录出来,聊以为笔记。

Summary of Heuristics

Heuristic 2.1 All data should be hidden within its class.

Heuristic 2.2 Users of a class must be dependent on its public interface, but a class should not be dependent on its users.

Heuristic 2.3 Minimize the number of messages in the protocol of a class.

Heuristic 2.4 Implement a minimal public interface that all classes understand [e.g., operations such as copy (deep versus shallow), equality testing, pretty printing, parsing from an ASCII description, etc.].

Heuristic 2.5 Do not put implementation details such as common-code private functions into the public interface of a class.

Heuristic 2.6 Do not clutter the public interface of a class with things that users of that class are not able to use or are not interested in using.

Heuristic 2.7 Classes should only exhibit nil or export coupling with other classes, that is, a class should only use operations in the public interface of another class or have nothing to do with that class.

Heuristic 2.8 A class should capture one and only one key abstraction.

Heuristic 2.9 Keep related data and behavior in one place.

Heuristic 2.10 Spin off nonrelated information into another class (i.e., noncommunicating behavior).

Heuristic 2.11 Be sure the abstractions that you model are classes and not simply the roles objects play.

    既然没有什么好说的,就不要说了,还不如静下心来搞些设计,在实践中体会OOD的精髓...... Practice make perfect!
Upon completion of an object-oriented design, you are faced with a troubling question: "Is it good, bad, or somewhere in between?" Seasoned experts often answer this question by subjecting the design to a subconscious list of guidelines based on their years of experience. Experienced developer Arthur J. Riel has captured this elusive, subconscious list, and in doing so, has provided a set of metrics that help determine the quality of object-oriented models.Object-Oriented Design Heuristics offers insight into object-oriented design improvement. The more than sixty guidelines presented in this book are language-independent and allow you to rate the integrity of a software design. The heuristics are not written as hard and fast rules; they are meant to serve as warning mechanisms which allow the flexibility of ignoring the heuristic as necessary. This tutorial-based approach, born out of the author's extensive experience developing software, teaching thousands of students, and critiquing designs in a variety of domains, allows you to apply the guidelines in a personalized manner.The heuristics cover important topics ranging from classes and objects (with emphasis on their relationships including association, uses, containment, and both single and multiple inheritance) to physical object-oriented design. You will gain an understanding of the synergy that exists between design heuristics and the popular concept of design patterns; heuristics can highlight a problem in one facet of a design while patterns can provide the solution.Programmers of all levels will find value in this book. The newcomer will discover a fast track to understanding the concepts of object-oriented programming. At the same time, experienced programmers seeking to strengthen their object-oriented development efforts will appreciate the insightful analysis. In short, with Object-Oriented Design Heuristics as your guide, you have the tools to become a better software developer.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值