详解<K's 50 PV> (下篇)

 

Explanatory Notes On <K's 50 PV>

详解<K's 50 PV > Revision 1.0

[下篇]

by  Kingofark

 

[]<K's 50 PV>是《Kingofark's 50 Points of View About Learning C++ And Programmingkingofark关于学习C++和编程的50个观点)》的简称;<K's 35 MPV>是《Kingofark's 35 More Points of View About Learning C++ And Programmingkingofark关于学习C++和编程的另外35个观点)》的简称。 

 

条款28. C++绝不是所谓的C的“扩充”——如果C++一开始就起名叫Z语言,你一定不会把CZ语言联系得那么紧密;

严正声明:对本条款的解说方式决不是kingofark偷懒的表现。详情见本文的后记。 

[解说]

请参考条款1。(完)(吐舌头) 

 

条款29. 请不要认为学过XX语言再改学C++会有什么问题——你只不过又在学一门全新的语言而已;

[解说]

同条款28的解说。(又吐舌头) 

 

条款30. 读完了《Inside The C++ Object Model》以后再来认定自己是不是已经学会了C++

[解说]

关于《Inside The C++ Object Model》:

C++成山似海的书籍堆中,这一本不是婴幼儿奶粉,也不是较大婴儿奶粉,它是成人专用的低脂高钙特殊奶粉。”

任何技术,习其表皮,即可把玩;探其隐匿,则能熟悉;得其精髓,方可掌故之,如使双手般精良到位。

人们对“会”这个字有着不同层次的理解。我以为,通常我们应该以最狭义的方式去理解它。这不是在苛求自己,而是在检查自己是不是足够浮躁。 

[kingofark的收获]

沉着的对自己说:“我什么都不会!”。 

 

条款31. 学习编程的秘诀是:编程,编程,再编程;

[解说]

“实践是检验真理的唯一标准”。这句话连中学课本中都有。

其实,“实践”不仅具有检验真理的功能,它还碰巧是个精干的多面手,可以帮助大家做很多事情——只要你诚心聘请它就可以了,甚至连免费咨询电话都不用打——心诚则灵。

不说了——大道理,说起来太张扬,恐有人给我带一顶“教条主义”的帽子。 

[kingofark的收获]

有些道理很大(甚至比太阳还大),但是真正懂它的人的数目却很小。 

 

条款32. 请留意下列书籍:《C++面向对象高效编程(C++ Effective Object-Oriented Software Construction)》《面向对象软件构造(Object-Oriented Software Construction)》《设计模式(Design Patterns)》《The Art of Computer Programming》;

[解说]

对书籍的讨论,我留在我的系列拙文《kingofark的“五评计划”》中慢慢进行。这里只想指出一点:《C++ Effective Object-Oriented Software Construction》一书在国外已经有了第二版了。 

 

条款33. 记住:面向对象技术不只是C++专有的;

[解说]

同条款17 

 

条款34. 请把书上的程序例子亲手输入到电脑上实践,即使配套光盘中有源代码;

[解说]

自己输入源代码,且不说可以练指法,它还是一种研读代码的过程,这道理与看不懂原文就翻译不好文章一样。自己一字一句读过,才有可能通过键盘输入,于是自己在不知不觉中就已经读过一遍代码了。

我们常说代码总须多读才能明白些,难道你就愿意通过使用源代码光盘的卑鄙手段来放弃自己多一次的仔细阅读机会吗?

有人说用源代码光盘也能读代码。然而应该思考这样一点:只看光盘上的源代码,并不能保证你不一目十行、草草了事;而对着书输入源代码,你就不可能一目十行,因为那样的话你根本无法从键盘输入。

想想这两者之间种种潜在的差距吧!我想我们还是踏实一点为好。 

[kingofark的收获]

光盘上存储的仅仅只是供参考的源代码,不是研读带来的收获。 

 

条款35. 把在书中看到的有意义的例子扩充;

[解说]

同条款5 

 

条款36. 请重视C++中的异常处理技术,并将其切实的运用到自己的程序中;

[解说]

这一条基本上是在对我自己敲警钟。

早年学习C++的时候,国外的C++书籍还没有引进。至于当时国内的C++教材,要是参差不齐我倒可以满足了(因为毕竟“参差不齐”意味着并非没有好的),可偏偏就是一律整齐。那些教材的作(抄?)者,大凡把C教材的制作班底拿来remake一下,然后又贴上一些诸如inlineclassexception这样一些时髦的标签,再大喊一声“cut!”,即宣布一切搞定了,连take 2都用不着 [注:哦,这都是做影评(经常说“这个续集只不过是正集的一个remake”之类的话)、拍电影(导演喊“cut!”)、录音乐(录制take 1take2等)使用的术语]。在这些“C++教材”中,很多C++的重要特性都被作为一个小到令人乍舌的章节来介绍,活像影片中闪现不到半秒钟的色情镜头——想看的人心中大呼不过瘾,不想看的人则吃惊中带些厌恶。结果我当时几乎没学过异常处理的知识。

现在国内外优秀的C++书籍多了,我才得以重新完整的学习C++。这一次,我可不能再学不伦不类的“C Remake++”语言了。 

 

条款37. 经常回顾自己以前写过的程序,并尝试重写,把自己学到的新知识运用进去;

[解说]

除了参考条款5之外,还想补充一点:

本观点并不是想暗示大家应该对C++的各个方面内容一字排开并按某种顺序学习,而只是说明在不断学习提高的过程中,自己的实践经验也应该得到相应的积累。其实我觉得要把这件事做好,涉及到比想象中更多的事情,其中至少包括为自己的程序做文档以便于日后查看、重读。

这件事真是说来容易做来难,我们还有很多需要努力的地方,不是吗? 

 

条款38. 不要漏掉书中任何一个练习题——请全部做完并记录下解题思路;

[解说]

同条款5 

 

条款39. C++语言和C++的集成开发环境要同时学习和掌握;

[解说]

见条款6 

 

条款40. 既然决定了学C++,就请坚持学下去,因为学习程序设计语言的目的是掌握程序设计技术,而程序设计技术是跨语言的;

[解说]

这里说的“坚持”,绝不意味着迷信和狂热的崇拜(参见条款50),而应该意味着不浮躁,能够静下心来,扎扎实实打好基础。 

[kingofark的收获]

抗拒浮躁的过程有一点点像憋尿,当然两者的结果和产生的影响大不相同。 

[参考]

<K’s 50 PV>条款50 

 

条款41. 就让C++语言的各种平台和开发环境去激烈的竞争吧,我们要以学习C++语言本身为主;

[解说]

见条款6和条款9 

 

条款42. 当你写C++程序写到一半却发现自己用的方法很拙劣时,请不要马上停手;请尽快将余下的部分粗略的完成以保证这个设计的完整性,然后分析自己的错误并重新设计和编写(参见43);

条款43. 别心急,设计C++class确实不容易;自己程序中的class和自己的class设计水平是在不断的编程实践中完善和发展的;

[解说]

古墓丽影(Tomb Raider)这个游戏想必大家都已经很熟悉了。当《古墓丽影:最后的启示(Tomb Raider : Last Revelation)》正式发行后,我和好友zy当然也乐此不疲的买了游戏光盘,和性感美丽的Lara Croft3D世界中同甘共苦。

事情就这样开了:

好友zy忽然有一天在电话中告知我说,Lara要与一个巨大的石头脸进行一种规则较为简单的格子棋游戏。棋盘是单向无环路的,有起点和终点;下棋双方每边各有三个棋子,通过随机的方式得到一定范围内的步数来走棋;正常情况下,每一方每次只有一次确定步数的机会并只能选一个棋子走棋;如果被移动的棋子在移动后停在某些特定的位置上,那就可以再走一次棋;特别的,如果得到的步数是某些特定的数字,则也可以再走一次棋;谁先把自己的三个棋子走完就算谁赢。

我们讨论了半天,觉得这个简单的游戏可以很容易写出C++代码来,于是就开始做设计。虽然朋友很快就退出改玩游戏去了,但还是给了我很多建议。

第一遍设计出来之后,我养成的种种坏习惯复发了。等到代码成形,里面已经充斥着杂乱的结构体和全局变量了。而且由于抽象的不合理,代码中处处都存在着重复的代码段。看着一堆垃圾般的代码,我的信心好像碰到异物的蜗牛触角一样刹那间飞也似的缩走了,。

然而,不能接受“程序甚至还不能编译执行”这样一个事实的我不能释怀,只好硬着头皮继续写下去,越写越看出自己代码中的龌龊。结果当然是bug满宇宙飞,想修改都不容易了。只好作罢,继续自己每天正常的C++学习。

若干个月之后,当我偶然从废纸堆中翻到那个bug.exe的原始设计草稿时,我又忍不住重新思考这个问题了。几个月的C++学习毕竟不是全没有作用,因此在充分认识到以前代码的缺陷的前提下,我的脑海里涌出了许多新思路,真所谓长江后浪推前浪……

现在回想起来觉得,倘若当时第一次就半途而废,或许还不会对其中的不足之处有那么深的印象。这才发觉差劲的代码原来也是搞自我批评的重大阵营。 

[kingofark的收获]

做什么事都不要虎头蛇尾。就连把坏事做一半所得到的教训,也不如把坏事做完得到的教训深刻。 

 

条款44. 决不要因为程序“很小”就不遵循某些你不熟练的规则——好习惯是培养出来的,而不是一次记住的;

[解说]

参见条款26 

 

条款45. 每学到一个C++难点的时候,尝试着对别人讲解这个知识点并让他理解——你能讲清楚才说明你真的理解了;

[解说]

这个道理涉及到一些鲜为人知的一系列心理学、教育学方面的问题,我不在此累述。大家只用记住:转述的过程,也是人们常说的“把知识变成自己的”之过程的一种表现形式。 

[kingofark的收获]

题外话:有学问的老师未必讲课讲得好;讲课讲得好的老师未必有学问,但他/她总能把自己懂的那一部分知识讲清楚。我更喜欢后一种老师。 

 

条款46. 记录下在和别人交流时发现的自己忽视或不理解的知识点;

[解说]

当你发现别人比你知道得多的时候,你不羡慕吗?不嫉妒吗?不敬佩吗?不崇拜吗?不自卑吗?不想超过他吗?

随身带张纸,带支笔,并不会累死你的。 

[kingofark的收获]

就算是天上真的掉下馅饼了,也还是需要你伸手去捡着吃的。如果你仅仅因为懒得伸手而不去吃,那可就比迷信“天上掉馅饼”的人还要可悲了。 

 

条款47. 请不断的对自己写的程序提出更高的要求,哪怕你的程序版本号会变成Version 100.XX

[解说]

同条款37 

 

条款48. 保存好你写过的所有的程序——那是你最好的积累之一;

[解说]

理由一:如果你不保存好,就无法遵守条款353747了;

理由二:越来越多的代码多少会给人一种成就感,可以在不经意之间增强自信心。 

[kingofark的收获]

理由三:万一自己以后出了名,还可以在电视直播或者自传里面把代码拿出来,作为训诫后人、为人师表的本钱,谱写一曲老当益壮的精神文明凯歌。 

 

条款50. 请热爱C++!

[解说]

请热爱C++,但是切忌蜕变成目光短浅的、迷信C++的狂热分子。 

[kingofark最后的收获]

C++说:“Everybody says I love you but no more. 

 

[K’s 50 PV 后记]

回顾这50条,揪心的发现其中有许多的重复观点,只是用了不同的表述而已。

这也与< K’s 50 PV>的成因有关。

最初是在CSDN的论坛上看到一篇人气颇旺的贴文,讨论些学习C/C++的经验,忽然使我有了对过去学习的感触,一些自己揣摩的文字猛然间如滔滔江水连绵不绝,又如黄河泛滥一发不可收拾,死心塌地、义无反顾的从脑海里泄将出来。

其实最后写出来的,无非是些众所周知的“耳茧增长因子”,全没有女人裸体见情人般的光彩。但自己还是不免浮躁的得意起来,淫笑着将这些文字发成贴子,收获了一次在公共场所署上自己大名的快感。

等到我严肃得要给她写注解的时候,才很尴尬的注意到自己的无知与浅薄。于是很无能的继续写下去。这一次,便有了女人裸体见陌生人的尴尬——还是全裸。

惭愧、羞愧一并涌上脸来,铁青。

无地自容。是以为记。

  • 0
    点赞
  • 0
    收藏
  • 打赏
    打赏
  • 0
    评论
Contents Preface v Foreword to the second edition xiii About the accompanying CD-ROM xiv On the bibliography, Internet sources and exercises xv Contents xvii PART A: THE ISSUES 1 Chapter 1: Software quality 3 1.1 EXTERNAL AND INTERNAL FACTORS 3 1.2 A REVIEW OF EXTERNAL FACTORS 4 1.3 ABOUT SOFTWARE MAINTENANCE 17 1.4 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 19 1.5 BIBLIOGRAPHICAL NOTES 19 Chapter 2: Criteria of object orientation 21 2.1 ON THE CRITERIA 21 2.2 METHOD AND LANGUAGE 22 2.3 IMPLEMENTATION AND ENVIRONMENT 31 2.4 LIBRARIES 33 2.5 FOR MORE SNEAK PREVIEW 34 2.6 BIBLIOGRAPHICAL NOTES AND OBJECT RESOURCES 34 PART B: THE ROAD TO OBJECT ORIENTATION 37 Chapter 3: Modularity 39 3.1 FIVE CRITERIA 40 3.2 FIVE RULES 46 3.3 FIVE PRINCIPLES 53 3.4 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 64 3.5 BIBLIOGRAPHICAL NOTES 64 EXERCISES 65CONTENTS xviii Chapter 4: Approaches to reusability 67 4.1 THE GOALS OF REUSABILITY 68 4.2 WHAT SHOULD WE REUSE? 70 4.3 REPETITION IN SOFTWARE DEVELOPMENT 74 4.4 NON-TECHNICAL OBSTACLES 74 4.5 THE TECHNICAL PROBLEM 81 4.6 FIVE REQUIREMENTS ON MODULE STRUCTURES 83 4.7 TRADITIONAL MODULAR STRUCTURES 89 4.8 OVERLOADING AND GENERICITY 93 4.9 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 98 4.10 BIBLIOGRAPHICAL NOTES 99 Chapter 5: Towards object technology 101 5.1 THE INGREDIENTS OF COMPUTATION 101 5.2 FUNCTIONAL DECOMPOSITION 103 5.3 OBJECT-BASED DECOMPOSITION 114 5.4 OBJECT-ORIENTED SOFTWARE CONSTRUCTION 116 5.5 ISSUES 117 5.6 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 119 5.7 BIBLIOGRAPHICAL NOTES 119 Chapter 6: Abstract data types 121 6.1 CRITERIA 122 6.2 IMPLEMENTATION VARIATIONS 122 6.3 TOWARDS AN ABSTRACT VIEW OF OBJECTS 126 6.4 FORMALIZING THE SPECIFICATION 129 6.5 FROM ABSTRACT DATA TYPES TO CLASSES 142 6.6 BEYOND SOFTWARE 147 6.7 SUPPLEMENTARY TOPICS 148 6.8 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 159 6.9 BIBLIOGRAPHICAL NOTES 160 EXERCISES 161 PART C: OBJECT-ORIENTED TECHNIQUES 163 Chapter 7: The static structure: classes 165 7.1 OBJECTS ARE NOT THE SUBJECT 165 7.2 AVOIDING THE STANDARD CONFUSION 166 7.3 THE ROLE OF CLASSES 169 7.4 A UNIFORM TYPE SYSTEM 171 7.5 A SIMPLE CLASS 172 7.6 BASIC CONVENTIONS 177CONTENTS xix 7.7 THE OBJECT-ORIENTED STYLE OF COMPUTATION 181 7.8 SELECTIVE EXPORTS AND INFORMATION HIDING 191 7.9 PUTTING EVERYTHING TOGETHER 194 7.10 DISCUSSION 203 7.11 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 213 7.12 BIBLIOGRAPHICAL NOTES 215 EXERCISES 216 Chapter 8: The run-time structure: objects 217 8.1 OBJECTS 218 8.2 OBJECTS AS A MODELING TOOL 228 8.3 MANIPULATING OBJECTS AND REFERENCES 231 8.4 CREATION PROCEDURES 236 8.5 MORE ON REFERENCES 240 8.6 OPERATIONS ON REFERENCES 242 8.7 COMPOSITE OBJECTS AND EXPANDED TYPES 254 8.8 ATTACHMENT: REFERENCE AND VALUE SEMANTICS 261 8.9 DEALING WITH REFERENCES: BENEFITS AND DANGERS 265 8.10 DISCUSSION 270 8.11 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 276 8.12 BIBLIOGRAPHICAL NOTES 277 EXERCISES 277 Chapter 9: Memory management 279 9.1 WHAT HAPPENS TO OBJECTS 279 9.2 THE CASUAL APPROACH 291 9.3 RECLAIMING MEMORY: THE ISSUES 293 9.4 PROGRAMMER-CONTROLLED DEALLOCATION 294 9.5 THE COMPONENT-LEVEL APPROACH 297 9.6 AUTOMATIC MEMORY MANAGEMENT 301 9.7 REFERENCE COUNTING 302 9.8 GARBAGE COLLECTION 304 9.9 PRACTICAL ISSUES OF GARBAGE COLLECTION 309 9.10 AN ENVIRONMENT WITH MEMORY MANAGEMENT 312 9.11 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 315 9.12 BIBLIOGRAPHICAL NOTES 315 EXERCISES 316 Chapter 10: Genericity 317 10.1 HORIZONTAL AND VERTICAL TYPE GENERALIZATION 317 10.2 THE NEED FOR TYPE PARAMETERIZATION 318 10.3 GENERIC CLASSES 320CONTENTS xx 10.4 ARRAYS 325 10.5 THE COST OF GENERICITY 328 10.6 DISCUSSION: NOT DONE YET 329 10.7 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 329 10.8 BIBLIOGRAPHICAL NOTES 330 EXERCISES 330 Chapter 11: Design by Contract: building reliable software 331 11.1 BASIC RELIABILITY MECHANISMS 332 11.2 ABOUT SOFTWARE CORRECTNESS 333 11.3 EXPRESSING A SPECIFICATION 334 11.4 INTRODUCING ASSERTIONS INTO SOFTWARE TEXTS 337 11.5 PRECONDITIONS AND POSTCONDITIONS 338 11.6 CONTRACTING FOR SOFTWARE RELIABILITY 341 11.7 WORKING WITH ASSERTIONS 348 11.8 CLASS INVARIANTS 363 11.9 WHEN IS A CLASS CORRECT? 369 11.10 THE ADT CONNECTION 373 11.11 AN ASSERTION INSTRUCTION 378 11.12 LOOP INVARIANTS AND VARIANTS 380 11.13 USING ASSERTIONS 389 11.14 DISCUSSION 398 11.15 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 406 11.16 BIBLIOGRAPHICAL NOTES 407 EXERCISES 408 POSTSCRIPT: THE ARIANE 5 FAILURE 410 Chapter 12: When the contract is broken: exception handling 411 12.1 BASIC CONCEPTS OF EXCEPTION HANDLING 411 12.2 HANDLING EXCEPTIONS 414 12.3 AN EXCEPTION MECHANISM 419 12.4 EXCEPTION HANDLING EXAMPLES 422 12.5 THE TASK OF A RESCUE CLAUSE 427 12.6 ADVANCED EXCEPTION HANDLING 431 12.7 DISCUSSION 435 12.8 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 437 12.9 BIBLIOGRAPHICAL NOTES 438 EXERCISES 438 Chapter 13: Supporting mechanisms 439 13.1 INTERFACING WITH NON-O-O SOFTWARE 439 13.2 ARGUMENT PASSING 444CONTENTS xxi 13.3 INSTRUCTIONS 447 13.4 EXPRESSIONS 452 13.5 STRINGS 456 13.6 INPUT AND OUTPUT 457 13.7 LEXICAL CONVENTIONS 457 13.8 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 458 EXERCISES 458 Chapter 14: Introduction to inheritance 459 14.1 POLYGONS AND RECTANGLES 460 14.2 POLYMORPHISM 467 14.3 TYPING FOR INHERITANCE 472 14.4 DYNAMIC BINDING 480 14.5 DEFERRED FEATURES AND CLASSES 482 14.6 REDECLARATION TECHNIQUES 491 14.7 THE MEANING OF INHERITANCE 494 14.8 THE ROLE OF DEFERRED CLASSES 500 14.9 DISCUSSION 507 14.10 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 516 14.11 BIBLIOGRAPHICAL NOTES 517 EXERCISES 517 Chapter 15: Multiple inheritance 519 15.1 EXAMPLES OF MULTIPLE INHERITANCE 519 15.2 FEATURE RENAMING 535 15.3 FLATTENING THE STRUCTURE 541 15.4 REPEATED INHERITANCE 543 15.5 DISCUSSION 563 15.6 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 566 15.7 BIBLIOGRAPHICAL NOTES 567 EXERCISES 567 Chapter 16: Inheritance techniques 569 16.1 INHERITANCE AND ASSERTIONS 569 16.2 THE GLOBAL INHERITANCE STRUCTURE 580 16.3 FROZEN FEATURES 583 16.4 CONSTRAINED GENERICITY 585 16.5 ASSIGNMENT ATTEMPT 591 16.6 TYPING AND REDECLARATION 595 16.7 ANCHORED DECLARATION 598 16.8 INHERITANCE AND INFORMATION HIDING 605 16.9 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 609CONTENTS xxii 16.10 BIBLIOGRAPHICAL NOTE 610 EXERCISES 610 Chapter 17: Typing 611 17.1 THE TYPING PROBLEM 611 17.2 STATIC TYPING: WHY AND HOW 615 17.3 COVARIANCE AND DESCENDANT HIDING 621 17.4 FIRST APPROACHES TO SYSTEM VALIDITY 628 17.5 RELYING ON ANCHORED TYPES 630 17.6 GLOBAL ANALYSIS 633 17.7 BEWARE OF POLYMORPHIC CATCALLS! 636 17.8 AN ASSESSMENT 639 17.9 THE PERFECT FIT 640 17.10 KEY CONCEPTS STUDIED IN THIS CHAPTER 641 17.11 BIBLIOGRAPHICAL NOTES 641 Chapter 18: Global objects and constants 643 18.1 CONSTANTS OF BASIC TYPES 643 18.2 USE OF CONSTANTS 645 18.3 CONSTANTS OF CLASS TYPES 646 18.4 APPLICATIONS OF ONCE ROUTINES 648 18.5 CONSTANTS OF STRING TYPE 653 18.6 UNIQUE VALUES 654 18.7 DISCUSSION 656 18.8 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 659 18.9 BIBLIOGRAPHICAL NOTES 660 EXERCISES 660 PART D: OBJECT-ORIENTED METHODOLOGY: APPLYING THE METHOD WELL 661 Chapter 19: On methodology 663 19.1 SOFTWARE METHODOLOGY: WHY AND WHAT 663 19.2 DEVISING GOOD RULES: ADVICE TO THE ADVISORS 664 19.3 ON USING METAPHORS 671 19.4 THE IMPORTANCE OF BEING HUMBLE 673 19.5 BIBLIOGRAPHICAL NOTES 674 EXERCISES 674 Chapter 20: Design pattern: multi-panel interactive systems 675 20.1 MULTI-PANEL SYSTEMS 675 20.2 A SIMPLE-MINDED ATTEMPT 677CONTENTS xxiii 20.3 A FUNCTIONAL, TOP-DOWN SOLUTION 678 20.4 A CRITIQUE OF THE SOLUTION 682 20.5 AN OBJECT-ORIENTED ARCHITECTURE 684 20.6 DISCUSSION 693 20.7 BIBLIOGRAPHICAL NOTE 694 Chapter 21: Inheritance case study: “undo” in an interactive system 695 21.1 PERSEVERARE DIABOLICUM 695 21.2 FINDING THE ABSTRACTIONS 699 21.3 MULTI-LEVEL UNDO-REDO 704 21.4 IMPLEMENTATION ASPECTS 707 21.5 A USER INTERFACE FOR UNDOING AND REDOING 711 21.6 DISCUSSION 712 21.7 BIBLIOGRAPHICAL NOTES 715 EXERCISES 715 Chapter 22: How to find the classes 719 22.1 STUDYING A REQUIREMENTS DOCUMENT 720 22.2 DANGER SIGNALS 726 22.3 GENERAL HEURISTICS FOR FINDING CLASSES 731 22.4 OTHER SOURCES OF CLASSES 735 22.5 REUSE 740 22.6 THE METHOD FOR OBTAINING CLASSES 741 22.7 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 743 22.8 BIBLIOGRAPHICAL NOTES 744 Chapter 23: Principles of class design 747 23.1 SIDE EFFECTS IN FUNCTIONS 748 23.2 HOW MANY ARGUMENTS FOR A FEATURE? 764 23.3 CLASS SIZE: THE SHOPPING LIST APPROACH 770 23.4 ACTIVE DATA STRUCTURES 774 23.5 SELECTIVE EXPORTS 796 23.6 DEALING WITH ABNORMAL CASES 797 23.7 CLASS EVOLUTION: THE OBSOLETE CLAUSE 802 23.8 DOCUMENTING A CLASS AND A SYSTEM 803 23.9 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 806 23.10 BIBLIOGRAPHICAL NOTES 806 EXERCISES 807CONTENTS xxiv Chapter 24: Using inheritance well 809 24.1 HOW NOT TO USE INHERITANCE 809 24.2 WOULD YOU RATHER BUY OR INHERIT? 812 24.3 AN APPLICATION: THE HANDLE TECHNIQUE 817 24.4 TAXOMANIA 820 24.5 USING INHERITANCE: A TAXONOMY OF TAXONOMY 822 24.6 ONE MECHANISM, OR MORE? 833 24.7 SUBTYPE INHERITANCE AND DESCENDANT HIDING 835 24.8 IMPLEMENTATION INHERITANCE 844 24.9 FACILITY INHERITANCE 847 24.10 MULTIPLE CRITERIA AND VIEW INHERITANCE 851 24.11 HOW TO DEVELOP INHERITANCE STRUCTURES 858 24.12 A SUMMARY VIEW: USING INHERITANCE WELL 862 24.13 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 863 24.14 BIBLIOGRAPHICAL NOTES 863 24.15 APPENDIX: A HISTORY OF TAXONOMY 864 EXERCISES 869 Chapter 25: Useful techniques 871 25.1 DESIGN PHILOSOPHY 871 25.2 CLASSES 872 25.3 INHERITANCE TECHNIQUES 873 Chapter 26: A sense of style 875 26.1 COSMETICS MATTERS! 875 26.2 CHOOSING THE RIGHT NAMES 879 26.3 USING CONSTANTS 884 26.4 HEADER COMMENTS AND INDEXING CLAUSES 886 26.5 TEXT LAYOUT AND PRESENTATION 891 26.6 FONTS 900 26.7 BIBLIOGRAPHICAL NOTES 901 EXERCISES 902 Chapter 27: Object-oriented analysis 903 27.1 THE GOALS OF ANALYSIS 903 27.2 THE CHANGING NATURE OF ANALYSIS 906 27.3 THE CONTRIBUTION OF OBJECT TECHNOLOGY 907 27.4 PROGRAMMING A TV STATION 907 27.5 EXPRESSING THE ANALYSIS: MULTIPLE VIEWS 914 27.6 ANALYSIS METHODS 917 27.7 THE BUSINESS OBJECT NOTATION 919 27.8 BIBLIOGRAPHY 922CONTENTS xxv Chapter 28: The software construction process 923 28.1 CLUSTERS 923 28.2 CONCURRENT ENGINEERING 924 28.3 STEPS AND TASKS 926 28.4 THE CLUSTER MODEL OF THE SOFTWARE LIFECYCLE 926 28.5 GENERALIZATION 928 28.6 SEAMLESSNESS AND REVERSIBILITY 930 28.7 WITH US, EVERYTHING IS THE FACE 933 28.8 KEY CONCEPTS COVERED IN THIS CHAPTER 934 28.9 BIBLIOGRAPHICAL NOTES 934 Chapter 29: Teaching the method 935 29.1 INDUSTRIAL TRAINING 935 29.2 INTRODUCTORY COURSES 937 29.3 OTHER COURSES 941 29.4 TOWARDS A NEW SOFTWARE PEDAGOGY 942 29.5 AN OBJECT-ORIENTED PLAN 946 29.6 KEY CONCEPTS STUDIED IN THIS CHAPTER 948 29.7 BIBLIOGRAPHICAL NOTES 948 PART E: ADVANCED TOPICS 949 Chapter 30: Concurrency, distribution, client-server and the Internet 951 30.1 A SNEAK PREVIEW 951 30.2 THE RISE OF CONCURRENCY 953 30.3 FROM PROCESSES TO OBJECTS 956 30.4 INTRODUCING CONCURRENT EXECUTION 964 30.5 SYNCHRONIZATION ISSUES 977 30.6 ACCESSING SEPARATE OBJECTS 982 30.7 WAIT CONDITIONS 990 30.8 REQUESTING SPECIAL SERVICE 998 30.9 EXAMPLES 1003 30.10 TOWARDS A PROOF RULE 1022 30.11 A SUMMARY OF THE MECHANISM 1025 30.12 DISCUSSION 1028 30.13 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 1032 30.14 BIBLIOGRAPHICAL NOTES 1033 EXERCISES 1035CONTENTS xxvi Chapter 31: Object persistence and databases 1037 31.1 PERSISTENCE FROM THE LANGUAGE 1037 31.2 BEYOND PERSISTENCE CLOSURE 1039 31.3 SCHEMA EVOLUTION 1041 31.4 FROM PERSISTENCE TO DATABASES 1047 31.5 OBJECT-RELATIONAL INTEROPERABILITY 1048 31.6 OBJECT-ORIENTED DATABASE FUNDAMENTALS 1050 31.7 O-O DATABASE SYSTEMS: EXAMPLES 1055 31.8 DISCUSSION: BEYOND O-O DATABASES 1058 31.9 KEY CONCEPTS STUDIED IN THIS CHAPTER 1060 31.10 BIBLIOGRAPHICAL NOTES 1061 EXERCISES 1062 Chapter 32: Some O-O techniques for graphical interactive applications 1063 32.1 NEEDED TOOLS 1064 32.2 PORTABILITY AND PLATFORM ADAPTATION 1066 32.3 GRAPHICAL ABSTRACTIONS 1068 32.4 INTERACTION MECHANISMS 1071 32.5 HANDLING THE EVENTS 1072 32.6 A MATHEMATICAL MODEL 1076 32.7 BIBLIOGRAPHICAL NOTES 1076 PART F: APPLYING THE METHOD IN VARIOUS LANGUAGES AND ENVIRONMENTS 1077 Chapter 33: O-O programming and Ada 1079 33.1 A BIT OF CONTEXT 1079 33.2 PACKAGES 1081 33.3 A STACK IMPLEMENTATION 1081 33.4 HIDING THE REPRESENTATION: THE PRIVATE STORY 1085 33.5 EXCEPTIONS 1088 33.6 TASKS 1091 33.7 FROM ADA TO ADA 95 1092 33.8 KEY CONCEPTS INTRODUCED IN THIS CHAPTER 1097 33.9 BIBLIOGRAPHICAL NOTES 1097 EXERCISES 1098CONTENTS xxvii Chapter 34: Emulating object technology in non-O-O environments 1099 34.1 LEVELS OF LANGUAGE SUPPORT 1099 34.2 OBJECT-ORIENTED PROGRAMMING IN PASCAL? 1100 34.3 FORTRAN 1102 34.4 OBJECT-ORIENTED PROGRAMMING AND C 1106 34.5 BIBLIOGRAPHICAL NOTES 1112 EXERCISES 1112 Chapter 35: Simula to Java and beyond: major O-O languages and environments 1113 35.1 SIMULA 1113 35.2 SMALLTALK 1126 35.3 LISP EXTENSIONS 1130 35.4 C EXTENSIONS 1131 35.5 JAVA 1136 35.6 OTHER O-O LANGUAGES 1137 35.7 BIBLIOGRAPHICAL NOTES 1138 EXERCISES 1139 PART G: DOING IT RIGHT 1141 Chapter 36: An object-oriented environment 1143 36.1 COMPONENTS 1143 36.2 THE LANGUAGE 1144 36.3 THE COMPILATION TECHNOLOGY 1144 36.4 TOOLS 1148 36.5 LIBRARIES 1150 36.6 INTERFACE MECHANISMS 1152 36.7 BIBLIOGRAPHICAL NOTES 1160 Epilogue, In Full Frankness Exposing the Language 1161

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:大白 设计师:CSDN官方博客 返回首页
评论

打赏作者

kingofark

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值