
《C++面向对象程序设计基于设计项目的方法》是2来自006年清华大学出版家社出版的图书,作者是(美)周孟初。
- 书名 C++面向对象程序设计:基于设计项目的方法
- 作者 (美)周孟初
- 出版社 清华大学出版社
- 出版时间 2006年1月1日
- 版次 1
图书信息
丛书名: 现代计算机教育系列教材
平装: 464页
开本: 16开
ISBN: 7302116032
条形码: 9787302116035
尺寸: 23 x 18.6 x 1.9 cm
重量: 680 g
作者简介
作者:朱海滨 (美)周孟初
朱海滨现为加拿大尼波星大口老学(Nipissing University)计算机与数学系助理教授,尼波星大学学科规划委员会话五治水意(Academic Planning Committee of Ni来自pissing University)委员,湖南大学软件学院兼职教授,国际电气电子工程师学会(IEEE) 高级会员(senior member), 国际计算机器学会(ACM)会员(mem360百科ber),中国旅美科技学会(CAST\USA谈出)终身会员(life member)。1988年和1997年分别获中国国防科技大学硕士和博士推利包学位。曾任2003变沿增片年国际电气工程师协会系统人控制论(IEEE SMC)国际会议程序委员,2于坚导举令南鸡004年加拿大软件工程土转路酸教育年会程序委员,2004年国际电气工程师协会系统眼由边害位死孙欢属\人\控制论(IEEE SMC)否故些国际会议程序委员。曾任美国新重民希泽西理工学院访问教授和错消站特聘讲师,中国国防科技大学教授,国防科技大学学术(科技)委员会委员, 国防科技大学计算机系学术委员会委员, 湖南省计算机学会计算机体系结构与网络专业委员会副主任。曾获国际并行工程会议(ISPE/CE 2004)最佳论文奖, 国轻际商用机器公司(IB
内容简介
本书系统地讨论了利右损金读乱府压新具配乐用C++语言进行面向对象程序设计的基本概念、原理、方法和语言机制。本书"原理第一、语言第二"的独特编写方法可以尽量避免读者在用C++学习面向对象程序设计时经常出现的问题,即,利用C++语言编写出非面向对象的程序。
本书力图用日常生活实例引入面向对象的基本概念和原理,从而使具有一定生活常识和经验的读者更易于接受。本书基于项目、逐步学习的方法能使读来自者更愿意编写可运行的C++360百科程序--从实践中学习。这样,本书虽主要面向计算机相关专业的读者编写,但相关工科专业(如电子工程和工业工程)的读者仍然能够根走困祖据少量计算机专业基础理解本书内容,并通过本书学习用C++编写面向对象的程序。
本书可作为计算机相克福喜根律丰黄关专业面向对象程序设计课程的教材,亦可作为其他工科专业学习面向对象该操垂鲜滑员扬程序设计的教材,同时还可以作为程序员或软件工程师的尽架映出希蒸太料程序设计参考书。
目录
Part 1Principles of Object\Orient说展至官ed Programming
CHAPTER 1Introduction to Object\Oriented Programming
1.1Object\Ori院言ented Thinking Methodology6
1.1.1Induction and Deduction6
色世 1.1.2Compositi按未着激本争on and Decompos而案元谈心华该未群药次ition7
1联助地.1.3Object\Or围由ientation as a Thinking Methodology9
1.2P错督念西联叫刑日材rogramming T创雨记握屋刻额斗根难echniques and Concepts11
1.2.1What is Programming?11
1.2.2Abstraction, Information Hid氢听袁是字抓金ing and Modelin今握念境跟演扩短审胜g13
1.2.3Procedural Programming and Modules15
1.2.4Encapsulation18
1.2.5Abstract Data Type20
1.3Obj起ect\Oriented Programming21
1.4Other Programming Pa基酒搞投重乱小radigms24
1.4.1Imperative Programming25
1.4.2Functional Programming25
1.4.3Logic Programming26
1.4.4Relationships between Object\Oriented Programming and Other
Paradigms27
1.5Object\Oriented Languages28
1.5.1Simula 6728
1.5.2Smalltalk29
1.5.3C++30
1.5.4Java31
1.5.5C#32
1.5.6Others33
1.6Summary34
CHAPTER 2Object, Classes and Inheritance
2.1Object39
2.1.1Real\|World Object Properties39
2.1.2Virtual Objects41
2.1.3The External and Internal View of an Object42
2.1.4Definition of an Object43
Contents Object\Oriented Programming in C++: A Project\|Based Approach 2.2Message43
2.2.1The Only Way to Interact43
2.2.2Definition of a Message44
2.2.3Message Categories45
2.2.4Objects in Programming45
2.3Encapsulation and Protocol45
2.4Class46
2.4.1Abstraction46
2.4.2Classification47
2.4.3The Basic View of a Class48
2.4.4Class Definition49
2.4.5Relationships among Classes50
2.4.6The Characteristics of a Class50
2.5Instantiation51
2.6Metaclass53
2.7Inheritance55
2.7.1The Properties of Inheritance55
2.7.2Inheritance Definition56
2.7.3Categories of Inheritance57
2.7.4Naming Conflicts58
2.7.5Precedence Conflicts59
2.8Superclass and Subclass60
2.8.1Subclassing60
2.8.2Modifiability61
2.9Abstract Class61
2.10Summary63
CHAPTER 3Polymorphism, Dynamic Binding, Overloading and
Other Concepts3.1Polymorphism69
3.1.1General Meanings of Polymorphism69
3.1.2Introduction of Polymorphism to Programming Languages70
3.1.3Categories of Polymorphism71
3.1.4The Drawbacks of Polymorphism73
3.2Overloading75
3.2.1Overloading Based on Scopes 75
3.2.2Overloading Based on Type Signatures76
3.3Static and Dynamic Binding77
3.4Overriding79
3.4.1Overriding Variables80
3.4.2Overriding Methods82
3.5Other Object\Oriented Programming Concepts82
3.5.1Object Interactions83
3.5.2Design Patterns86
3.5.3Objects and Agents95
3.5.4Object\Orientation and Reusable Components98
3.6Summary100
CHAPTER 4Object\Oriented Design
4.1Object\Oriented Software Engineering105
4.2Object\Oriented Design108
4.2.1OOA vs. OOD108
4.2.2OOD Steps and Tasks110
4.2.3Discussions114
4.3Unified Modeling Language115
4.3.1Use Case Modeling and Use Case Diagrams115
4.3.2Class and Object Diagrams117
4.3.3Association Diagram118
4.3.4Dynamic Modeling121
4.3.5Other Diagrams122
4.4CASE Tools for Object\Oriented Design123
4.4.1The Basic Architecture of OO ICASE Tools124
4.4.2Some ICASE Tools for OOA/OOD126
4.5Metrics of Object Systems128
4.5.1The Analysis for the Complexity of an Object System128
4.5.2Lorenz Metrics130
4.5.3The CK OO Metrics Suite132
4.5.4The Productivity Metrics of Object Systems134
4.6Summary135
Part 2Problem Solving with C++
CHAPTER 5Overview of the Basics of C++
5.1The Simplest C++ Program141
5.2Functions143
5.2.1Function Declaration and Definition143
5.2.2Parameters and Arguments144
5.2.3Constant Reference Parameter147
5.2.4Returned Values148
5.2.5Default Arguments148
5.2.6Viewing Functions as Objects149
5.3Fundamental Objects in C++150
5.3.1Basic Classes and Their Instances151
5.3.2Variable Declaration153
5.3.3Variable Scopes154
5.4Basic Streams for Input and Output156
5.4.1Output Stream156
5.4.2Input Stream157
5.5C++ Control Structures158
5.5.1Sequential Statements158
5.5.2Conditional Structures159
5.5.3Iterative Structures161
5.6Pointers and Memory Allocation165
5.6.1Pointers to Constants167
5.6.2Constant Pointers168
5.6.3Pointers and Arrays168
5.6.4Void Pointers170
5.6.5Allocating Memory172
5.6.6Functions Returning a Pointer175
5.7Summary177
CHAPTER 6Objects and Classes in C++
6.1Project Description181
6.2Analysis and Design182
6.3Class183
6.4Accessing Modifiers184
6.5Member Function Implementation186
6.6Constructors189
6.7Destructor190
6.8Enumeration191
6.9Switch/Case Structure and rand() Function193
6.10Basic Do\|Loop Structure197
6.11Instantiation and Messages198
6.12Standard Input and Output Streams200
6.13Deleting Objects201
6.14The Complete main() Function for the Project 202
6.15Object Copying204
6.16Summary207
CHAPTER 7Inheritance in C++
7.1Project Description211
7.2Analysis and Design212
7.3Base and Derived Classes215
7.3.1Static Variable217
7.4Overriding218
7.5Accessibility of Inherited Members219
7.6Constructor Initializer225
7.7Constructor and Destructor Execution Order226
7.8Creating Instances of Derived Classes227
7.9Create Report on Screen: More on Output Stream229
7.10Function main()232
7.11Running Result of Our Project234
7.12Multiple and Virtual Inheritance236
7.12.1Virtual Base Classes237
7.13Summary238
CHAPTER 8Polymorphism and Overloading in C++
8.1 Project Description: A Self\|Test Program243
8.2Analysis and Design244
8.3Abstract Classes and Virtual Functions247
8.4Derived Classes from an Abstract Class250
8.4.1Derived Abstract Class252
8.5The ExamPaper Class256
8.5.1Polymorphism and Dynamic Binding257
8.5.2Overloading Functions259
8.5.3Other Implementations259
8.6Function main()261
8.6.1Compatibility between Base and Derived Classes263
8.6.2The Main Loop of a Test266
8.6.3The Final Code of main()268
8.7Other Auxiliary Statements271
8.8Sample Running Results272
8.9Other C++ Concepts Relevant to Polymorphism275
8.9.1Polymorphism and Pointers275
8.9.2Virtual Destructors276
8.9.3"this" Pointer278
8.9.4Overloading Functions and Inheritance279
8.10Summary280
CHAPTER 9Templates, Exception Handling and Overloaded
Operators in C++9.1Project Description: A Dictionary Application285
9.2Analysis and Design287
9.3Templates288
9.4Exception Handling292
9.5Function main()298
9.6Auxiliary Statements and Running Results302
9.7Relevant Concepts with Templates305
9.7.1Class Templates and Classes305
9.7.2Function Templates306
9.7.3Overloaded Operators308
9.7.4Overloading a Function Template310
9.8Concepts Relevant with Exception Handling312
9.8.1Unwinding the Exception Stack312
9.8.2Exception with No Catch313
9.8.3Exception within an Exception314
9.8.4Exceptions in Templates316
9.8.5Grouping Exceptions317
9.8.6Re\|throwing an Exception318
9.8.7Exception Interface Specification319
9.9Summary320
CHAPTER 10Container Classes in C++
10.1Project Description: A Student Registration Program325
10.2Analysis and Design326
10.3Linked List327
10.3.1Simple Linked List328
10.3.2Doubly Linked List334
10.4Application of Simple List340
10.5Application of Doubly Linked List341
10.6An Auxiliary Class and Function main()346
10.7Compilation and Execution Results350
10.8Application of Doubly Linked List in a Polymorphic Way353
10.9Summary360
CHAPTER 11Streams and Friends in C++
11.1I/O Operators and Streams366
11.1.1Streams366
11.1.2Output of Basic Objects366
11.1.3Input of Basic Objects368
11.1.4The States of Streams370
11.1.5The Flags and Formats of Streams372
11.1.6Overloaded I/O Operators on Streams377
11.1.7Manipulators381
11.1.8File Streams386
11.1.9String Streams390
11.2Friend391
11.2.1Friend Functions392
11.2.2Friend Classes393
11.2.3Properties of Friends399
11.3Summary400
CHAPTER 12Use of the Standard Library of C++
12.1C++ STL405
12.1.1Containers and Algorithms406
12.1.2Iterators411
12.1.3Other Parts of the STL414
12.2List415
12.2.1The Interfaces of List416
12.2.2The Application of List416
12.2.3The Algorithm Library422
12.2.4Function Objects433
12.3Map434
12.3.1The Interfaces of Map and Pair435
12.3.2Application of Maps436
12.4String443
12.4.1The Interface of String443
12.4.2The Application of String445
12.5Summary448Index450References460
评论留言