- 0
- 0
- 约1.01万字
- 约 10页
- 2017-10-05 发布于河南
- 举报
61条面向对象设计的经验原则(61 empirical principles of object oriented design)
61条面向对象设计的经验原则(61 empirical principles of object oriented design)
61 empirical principles of object oriented design
You do not have to abide by these principles, and they will not be punished by religion.
But you should think of these principles as alarm bells, and if one of them breaks, the alarm rings.
-----Arthur J.Riel
(1) all data should be hidden within the class in which it is located. P13
(2) users of a class must rely on the shared interface of the class, but the class cannot rely on its users. P15
(3) minimize the message in the class agreement. P16
(4) implement the most basic public interfaces that all classes understand (e.g., copy operations (deep copy and shallow copy), equality judgment, correct output, description from ASCII, resolution, and so on.]. P16
(5) do not put the implementation details (such as the private function of placing common code) into the public interface of the class. P17
If the two methods of the class have a section of public code, you can create a private function that prevents these public code.
(6) do not disturb the public interface of a class with something that the user cannot use or is not interested in. P17
(7) there should be zero coupling between classes, or only the coupling relationship can be derived. That is, a class has nothing to do with the other class, or uses only the operations in the public interface of another class. P18
(8) a class should represent only one critical abstraction. P19
All classes in the package should be closed for changes in the same class of properties. If a change affects a package, it affects all classes in the package, without any impact on other packages
(9) place the relevant data and behavior centrally. P19
Designers should be aware of objects that get data from other objects through operations such as get. This type of behavior implies that this empirical principle is violated.
(10) putting irrelevant information in another class (i.e., behavior that does not communicate with each
您可能关注的文档
- (java)面相对象程序设计 复习题((Java) face object programming review questions).doc
- (二)统考考务管理系统考点申报使用说明((two) examination, examination and management system, test site declaration, instructions for use).doc
- (二) 变量和常量((two) variables and constants).doc
- (纠正版)怀旧动画金曲夜((correction Edition) nostalgic animation Golden Night).doc
- (八年级数学)图形的全等(二)—全等三角形的识 …((Mathematics of grade eight) the congruence of figures (two) - congruent triangles...).doc
- (转)现在当兵一年能拿多少补贴((transfer) how much subsidy can we get for a year in the army).doc
- (项目管理者联盟专稿)定量分析在it项目管理中的应用研究(Application of quantitative analysis in project management of IT project).doc
- 003操作系统样卷(003 operating system volume).doc
- 005-浅谈医院电子病历系统的发展与应用(广州新海医院)(The development and application of 005- on the hospital electronic medical record system (Guangzhou Xinhai hospital)).doc
- 009中国古代战车(009 ancient Chinese Chariot).doc
最近下载
- 专题2 数据采集与编码 学案(含解析)2025届高中信息技术.DOCX VIP
- 高中地理课件湘教版:1-1中国的人口和民族.ppt
- 鲁科版高中化学选择性必修1第3章物质在水溶液中的行为3.3.2沉淀溶解平衡的应用课件(内嵌音频+视频).ppt VIP
- 建筑施工安全管理论文【推荐】.doc VIP
- 2025年高考地理识图填图完全手册(扫描版).docx
- 防火封堵材料 GB23864-2023.pdf
- 专题2 数据采集与编码 课件 2025届高中信息技术.pptx VIP
- 专题1 数据与大数据 课件 2025届高中信息技术.pptx VIP
- 鲁科版高中化学选择性必修1第3章物质在水溶液中的行为3.3.1沉淀溶解平衡与溶度积(内嵌音频+视频).ppt VIP
- 2025年甘肃省高考物理试卷(含答案解析).docx VIP
原创力文档

文档评论(0)