Home > Store

Navigating C++ and Object-Oriented Design (Bk/CD-ROM)

Register your product to gain access to bonus material or receive a coupon.

Navigating C++ and Object-Oriented Design (Bk/CD-ROM)

Book

  • Sorry, this book is no longer in print.
Not for Sale

About

Features

  • Learn both C++ and object-oriented design at the same time.
  • Includes four sample applications, taking the reader through all aspects of a design, from choosing appropriate classes and objects to identifying the correct class relationships.
  • Learn how to improve the performance of existing C++ applications.
  • Includes exercises and a glossary of C++ and object-oriented terms that may be new to the reader.

Description

  • Copyright 1998
  • Dimensions: 7" x 9-1/4"
  • Pages: 832
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-532748-2
  • ISBN-13: 978-0-13-532748-7


53274-7

Learn ANSI C++ right from the start!

If you're going to learn C++, learn it right from the start! Navigating C++ and Object-Oriented Design is the first book that teaches ANSI C++ and the object-oriented techniques that make C++ a software development breakthrough.

This comprehensive tutorial reflects the authors' extensive experience teaching C++ to professional developers. Start with the clearest introduction to object modeling you'll ever read. Then learn all the essentials of C++ and more advanced topics such as exceptions, namespaces, and dynamic memory allocation.

Next, discover C++ classes, the basic building block of object-oriented design. Through proven analogies and examples, the authors introduce containment and inheritance, overloading, templates, RTTI, and exception handling. And, the authors' unique presentation on multiple inheritance will give you invaluable insights into this complex topic.

Learn to apply C++ and object-oriented techniques to real-world development. Discover how to design classes effectively using the authors' class design boilerplate. Understand how to design container classes. Walk through class designs using the powerful OMT methodology.

Navigating C++ and Object-Oriented Design is one of the first C++ tutorials that covers in detail powerhouse ANSI C++ features like:

  • Namespaces, bool, member templates, and RTTI
  • Explicit, export, and nothrow versions of new and delete
  • The IOStream Library and Standard Template Library

Why learn C++ simply as a "better C" when you can write C++ code that really meets its potential? One book shows you how: Navigating C++ and Object-Oriented Design!

Sample Content

Online Sample Chapter

Understanding C++ Program Structure

Table of Contents



1. Getting Started.

Object-Oriented Design. Object Modeling Technique (OMT). Object Model Notation. Scenarios. Putting It All Together. Key Point Summary. Exercises.



2. C++ Basics.

Data Representation and Built-in Types. Preprocessor Directives. Comments. Type-Safe I/O. Operators and Expressions. Control Flow Constructs. Putting It All Together. Key Point Summary. Exercises.



3. C++ Program Structure.

Functions. Structures and Unions. References with Functions. Storage Classes. Exceptions. Namespaces. Dynamic Memory Allocation. Putting It All Together. Key Point Summary. Exercises.



4. Classes.

What Is Encapsulation? Classes. Constructors. Destructors. What's this? Exception Objects. Const Objects. Volatile Objects. Copy Constructors. The Problem with Public Data Members. Data Member Objects. Class Member Initialization. Putting It All Together. Key Point Summary. Exercises.



5. Working with Classes.

Using explicit. Object Lifetimes. Static Data Members. Static Member Functions. Static Objects. Arrays of Class Objects. Pointers to Class Members. Friend Classes. Nested Classes. Local Classes. Putting It All Together. Key Point Summary. Exercises.



6. Overloading.

Why Overload Functions? Function Overloading. Overloading Resolution. Why Overload Operators? Overloadable Operators. Operator Functions. Putting It All Together. Key Point Summary. Exercises.



7. Class Design.

What Is Class Design? A Class Design Boilerplate. A String Class. A Range Integer Class. Putting It All Together. Key Point Summary. Exercises.



8. Object Storage Management.

Global new and delete. Class-Specific new and delete. Reference Counts. Putting It All Together. Key Point Summary. Exercises.



9. Template Functions.

Why Should Functions Be Generic? Template Function Definition. Template Function Instantiation. Overloading Template Functions. Specializing Template Functions. Putting It All Together. Key Point Summary. Exercises.



10. Template Classes.

Why Should Classes Be Generic? Template Class Definition. Template Class Instantiation. Specializing Template Classes. Containment with Template Classes. Composite Templates. Template Class Static Members. Constant Expression Parameters. Template Friend Functions. Template Friend Classes. Template Nested Classes. Member Templates. Putting It All Together. Key Point Summary. Exercises.



11. Inheritance.

Why Use Inheritance? Public Derivation. Subtypes. Virtual Functions. Protected Access. Using Declarations. Private Derivation. Protected Derivation. Summary of Derivation Options. Polymorphism with a Generic PtrList Class. Abstract Base Classes. Virtual Constructors. A Class Design Boilerplate with Inheritance. Putting It All Together. Key Point Summary. Exercises.



12. Run-Time Type Identification.

Why Is RTTI Necessary? The Dynamic Cast Operator. The Typeid Operator. RTTI Applications. Putting It All Together. Key Point Summary. Exercises.



13. Exception Handling.

Why Use Exceptions? Designing with Exceptions. Exception Hierarchies. Resource Management. Uncaught Exceptions. Exception Specifications. Unexpected Exceptions. Putting It All Together. Key Point Summary. Exercises.



14. Multiple Inheritance.

Why Use Multiple Inheritance? Multiple Inheritance Format. Multiple Inheritance Characteristics. Distinct Base Classes (Pattern 1). Multiple Inclusion (Pattern 2). Virtual Base Classes (Pattern 3). Interface and Implementation. Putting It All Together. Key Point Summary. Exercises.



Appendix A. IOStream Library.

Why Use the IOStream Library? IOStream Overview. IOStream Examples.



Appendix B. Standard Template Library.

Why Use STL? STL Overview. STL Examples. STL References.



Appendix C. C++ Operator Precedence.

C++ Operator Precedence.



Index.

Preface

Preface


An Expedition, Not a Tour
A packaged tour to a foreign country coddles groups of tourists who are led from tourist trap to tourist trap, getting a watered-down simplistic view of life. Most details are pre-planned, and tourists do not have to make many decisions en route. The experience is definitely low tech, with easy participation from toddler through senior citizen. The couch- potato is "at home," simply turning into a "coach potato."
By contrast, an expedition requires a high degree of planning by the participants, who require the latest in technology for equipment and strategy. Training occurs before the expedition begins and continues throughout the trek. Whether the expedition involves exploration, goal attainment, field study, or humanitarian work, the experience demands more from the participant than a tour. Any detailed expedition requires a navigating guide; hence, the title of this book.

Our Goals
Our aim with this book is to provide the reader with the opportunity of making an expedition with C++. We intend the material to be detailed and highly technical, with all the latest and greatest that ANSI C++ has become. We expect the reader to be an active participant, to seek challenge, and shun a necessarily watered-down approach that promises expertise in several weeks.
Navigating C++ and Object-Oriented Design is an ambitious book. Our goal is to provide a C++ reference book, a tutorial for C++ beginners, and an advanced book-all in one. The book has evolved over many years, changing with the ANSI C++ standard and with our experiences teaching C++ to industry professionals.
Navigating C++ and Object-Oriented Design started out as a book to teach C++. With years of classroom feedback, we honed the examples to teach specific concepts. Which programs really show how initialization and assignment differ with C++? Which examples make students understand the importance of virtual destructors? Why are container classes tricky to design, and what are the trade-offs? How does one go about designing classes? The best people to answer these questions are students, and we have benefited tremendously from their input.
The material in each chapter progresses from introductory to more advanced. Each chapter concludes with a "Putting It All Together" section that draws upon several features presented in the chapter. The examples presented here are frequently more involved and therefore more advanced. The Key Point Summary at the end of each chapter summarizes important points, and a set of Exercises is included in each chapter to augment the material. All chapters include Tips, which caution the user about common mistakes, give guidelines about design issues, or touch on interesting points that are asides to the main thread. We mark Tips with a compass icon, as shown.
The enclosed CD-ROM contains all of the sample programs and solutions to the exercises presented in this text. You will find implementations for several platforms, including Windows and UNIX-based C++ compilers. For revisions to this code, visit our web site at:
http://www.asgteach.com/
C++ is a big language, and it's not all easy. In an effort to be complete, we present some advanced material. Overloading the new and delete operators, protected derivation, and multiple inheritance, for example, are all advanced topics that a C++ newcomer can skip initially. Finally, one cannot use C++ effectively without using object-oriented design. While we do not attempt to teach object-oriented design methodologies in this book, we do want to teach C++ in the context of object-oriented design. Chapter 1 explores object modeling strategies, giving readers the "big picture" in designing with C++.

ANSI C++ Compatibility
If you are a practicing C++ programmer and would like to be current with the ANSI C++ standard, this book will help you. By describing all of the latest features and incorporating them into sample programs, this book makes every effort to be compatible with the current ANSI C++ standard. You'll discover all of the recent additions to the standard here, such as namespaces, the STL library, mutable, export, nothrow versions of operators new and delete, auto_ptr class, and member templates.
Over the years, the standard has added many features to the language. The major extension are templates, exception handling, and run-time type identification. These language extensions are important, because they play crucial roles in how you design programs with C++. For this reason, we believe these features should be integrated throughout the book (as they are in the C++ language) and not presented as an afterthought in an appendix.

The Order of Things
When language features are closely intertwined, teaching them strictly sequentially is sometimes difficult. For example, before learning about inheritance, you must learn about classes. Before learning about classes, you must learn about functions. Operator overloading requires knowledge of typing, functions, and classes. Good examples of polymorphic programming require template container classes with pointer semantics and inheritance. The end result is that inheritance is pushed towards the later chapters. While it hardly seems "right" that such a primary feature of C++ isn't covered sooner, the inheritance examples (Chapter 11) are more detailed and real-world. We show what inheritance is good for by using C++ features covered in earlier chapters. However, you may read any given chapter out of order. We make generous use of forward and backward references which point the reader to related topics covered in other sections of the book.

How to Read This Book
All readers should start with Chapter 1 (Getting Started). This chapter explores the important features of C++, such as inheritance, polymorphism, template container classes, and exception handling. Chapter 1 explains object modeling notations and concepts so that students learn more than just how to use C++ as a better C. It also gives a hint of where the book is going and what we are striving for. This approach shows you why a modeling notation with design concepts such as aggregation, association, inheritance, classes, and responsibilities is important. It explains what objects are and gives you a reason to learn C++.
Beginners who don't know C should proceed to Chapter 2 (C++ Basics). Beginners who know C can start with Chapter 4 (Classes) and use Chapter 2 and Chapter 3 for reference. Experienced C++ programmers should start with Chapter 7 (Class Design). This chapter introduces our class design boilerplate, an important foundation that we'll use throughout the rest of the book.
We recommend a sequential reading of the book, but that's not strictly necessary. As a new C++ user, you may want to tackle only portions of the language. What's essential to get started? Skim Chapter 2 and Chapter 3. Chapter 4 (Classes) is essential, as well as Chapter 7 (Class Design) and Chapter 11 (Inheritance). This, of course, limits you. But with another pass, you can pick up Overloading (Chapter 6) and Template Classes (Chapter 10). A third pass covers Working with Classes (Chapter 5), Template Functions (Chapter 9), Run-Time Type Identification (Chapter 12) and Exception Handling (Chapter 13). Finally, Object Storage Management (Chapter 8) and Multiple Inheritance (Chapter 14) complete the text. Now, come full circle and reread Chapter 1.

A Word About the Standard Template Library
The Standard Template Library (STL) is part of the ANSI C++ standard and, as such, is an important tool in any C++ programmer's toolbox. You will find an informative overview with numerous examples in Appendix B. However, we elected not to use STL containers in our examples throughout the book. Why not? The design of container classes (such as arrays, lists, stacks, and so forth) requires an understanding of C++ and the treatment of objects in the run-time environment. We recognize that container class design requires trade-offs. Our own class designs, therefore, gives us the most flexibility in how we present these issues. Our Array class, for example, explains copy and assignment semantics with operator overloading and helps you understand how the STL vector class works.
Our associative array class, Assoc, shows you how to map generic entries and separate lvalues from rvalues in expressions (a feature that the STL map class does not currently provide). Furthermore, our List class illustrates the importance of separate cooperating container and iterator classes. We cover the difference between value and pointer semantics with container classes and how this difference affects container class design. Readers will be able to better evaluate the STL container classes after understanding the issues from our designs.


Enjoy!
Paul and Gail Anderson

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020