C++ In Action: Industrial Strength Programming Techniques (With CD-ROM)

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

For any developer that have had the displeasure of working with Win32 API and/or MFC in C++, this book strikes a very sensitive cord. For the uninitiated, Win32 is an OO programmer's nightmare, and trying to build a decent OO framework on top of it is a Herculean effort that few has dared to attempt. MFC is better, but marginally so, as it ascends Win32 from a nightmare to a very bad dream. The lack of proper standard libraries for other facilities such as threading, sockets, etc. only adds to the hurdles that a C++ developer needs to overcome in order to implement the most trivial functionality in his or her program.

And along comes this book with the attempt to build an OO layer that encapsulates the horrendous details of the Windows API. Of course, only a limited subset of this monolithic API is addressed in the book, which is understandable. One might consider the whole subject of the book a case study rather than a shrink-rapped solution, which is well-worth the time and money spent on it. If you have programmed with either Win32 or MFC before, and have being stung by their awkward design, or lack thereof, then consider this book a mandatory reading assignment.

However, the main problem with this book is that it attempts to be a one-size-fits-all material. The first chapters vainly try to introduce the reader to the C++ programming language. And the remaining chapters are bloated with subsections covering the finer details of the language as they are needed. The whole assumption that a total C++ novice can understand the Win32 API (the problem), the OO layer (the solution), AND the C++ programming language along the way is a very ludicrous one. A novice will struggle endlessly with it, and will ultimately find him or herself given up and reverting to more classical texts on C++ and OOP before being able to stomach reading this book again. Alas, the wasted space on introducing C++ could have been put to better use by adding more depth to the material.

So, you might ask why the four stars. The subject matter is unique and direly needed. And the coverage is adequate if you realistically set your expectations. By all means, buy it and read it. You might find it useful or at least enlightening. I know I did. But don't come unprepared.

Author(s): Bartosz Milewski
Publisher: Addison Wesley Publishing Company
Year: 2001

Language: English
Commentary: +OCR
Pages: 348

.RO Release (\fContents......Page 1
Preface......Page 2
Language......Page 4
Techniques......Page 5
Software Project......Page 7
Language......Page 9
Global scope......Page 11
Local scope......Page 14
Embedded objects......Page 18
Inheritance......Page 20
Member functions and Interfaces......Page 22
Member function scope......Page 24
Types......Page 30
Exercises......Page 32
Abstract Data Types......Page 33
Exercises......Page 37
References......Page 39
Stack-based calculator......Page 43
Functional Specification......Page 44
Stubbed Implementation......Page 45
Calculator: Implementation......Page 47
Input: Implementation......Page 49
The Makefile......Page 52
Exercises......Page 53
Pointers......Page 55
Pointers vs. References......Page 56
Pointers and Arrays......Page 57
Pointers and Dynamic Memory Allocation......Page 60
Dynamic Data Structures......Page 62
Dynamic Stack......Page 63
Linked List......Page 65
String Table......Page 70
String Buffer......Page 71
Table Lookup......Page 74
Hash Table......Page 75
Test......Page 77
Exercises......Page 78
The Meaning of is-a......Page 79
Parse Tree......Page 80
Exercises......Page 83
Specification......Page 85
Stubbed Implementation......Page 87
Expanding Stubs......Page 89
Final Implementation. Not!......Page 91
Scanner......Page 92
Symbol Table......Page 97
Store......Page 99
Function Table......Page 102
Nodes......Page 109
Parser......Page 110
Main......Page 117
Initialization of Aggregates......Page 118
Exercises......Page 119
Operator overloading......Page 121
Passing by Value......Page 122
Value Semantics......Page 125
Techniques......Page 133
Techniques......Page 135
Improving Code Grouping......Page 137
Decoupling the Output......Page 138
Fighting Defensive Programming......Page 139
A Case of Paranoid Programming......Page 141
Fringes......Page 145
Improving Communication Between Classes......Page 147
Correcting Design Flaws......Page 151
Using Embedded Classes......Page 158
Combining Classes......Page 159
Combining Things using Namespaces......Page 160
Hiding Constants in Enumerations......Page 161
Hiding Constants in Local Variables......Page 164
Testing Boundary Conditions......Page 165
Templates......Page 168
Dynamic Array......Page 171
Separating Functionality into New Classes......Page 176
Standard Vector......Page 180
Code Review 5: Resource Management......Page 185
Exceptions......Page 186
Stack Unwinding......Page 187
Resources......Page 191
Ownership of Resources......Page 193
Smart Pointers......Page 194
Ownership Transfer: First Attempt......Page 195
Ownership Transfer: Second Attempt......Page 197
Safe Containers......Page 202
Iterators......Page 205
Error Propagation......Page 208
Conversion......Page 209
Conclusion......Page 211
Making Use of the Standard Template Library......Page 212
Reference Counting and Copy-On-Write......Page 215
End of Restrictions......Page 220
Exploring Streams......Page 223
The Calculator Object......Page 228
Command Parser......Page 230
Serialization and Deserialization......Page 232
In-Memory (De-) Serialization......Page 241
Multiple Inheritance......Page 243
Transactions......Page 244
Transient Transactions......Page 245
Persistent Transactions......Page 248
The Three-File Scheme......Page 250
The Mapping-File Scheme......Page 251
Caching......Page 254
Bulk Allocation......Page 256
Array new......Page 258
Macros......Page 260
Tracing Memory Leaks......Page 262
Debug Output......Page 265
Placement new......Page 267
Windows Techniques......Page 268
Of Macros and Wizards......Page 269
Programming Paradigm......Page 270
Hello Windows!......Page 272
Encapsulation......Page 277
Model-View-Controller......Page 278
Exception Specification......Page 284
Cleanup......Page 286
Application Icon......Page 287
Window Painting and the View Object......Page 290
The Canvas......Page 291
The WM_PAINT Message......Page 294
The Model......Page 296
Capturing the Mouse......Page 297
Adding Colors and Frills......Page 302
Stock Objects......Page 308
User Interface......Page 311
Child Windows......Page 312
Windows Controls......Page 313
Dialogs......Page 317
Commands and Menus......Page 321
Dynamic Menus......Page 322
Exercises......Page 327
Implementation Strategies......Page 328
Complexity......Page 329
The Fractal Nature of Software......Page 331
The Living Project......Page 333
The Living Programmer......Page 334
Top-Down Object Oriented Design......Page 336
Model-View-Controller......Page 337
Requirement Specification......Page 338
Architecture Specification......Page 339
Productivity......Page 340
Team Strategies......Page 342
Global Decisions......Page 344
Top-Down Object Oriented Implementation......Page 345
Multi-platform development......Page 346
Program Modifications......Page 347
Stress Testing......Page 348