Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Deciphering Object-Oriented Programming with C++ [WARNING: NOT FOR USE IN OTHER MATERIAL/SEE CONTRACT]

You're reading from   Deciphering Object-Oriented Programming with C++ [WARNING: NOT FOR USE IN OTHER MATERIAL/SEE CONTRACT] A practical, in-depth guide to implementing object-oriented design principles to create robust code

Arrow left icon
Product type Paperback
Published in Sep 2022
Publisher Packt
ISBN-13 9781804613900
Length 594 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Dorothy R. Kirk Dorothy R. Kirk
Author Profile Icon Dorothy R. Kirk
Dorothy R. Kirk
Arrow right icon
View More author details
Toc

Table of Contents (30) Chapters Close

Preface 1. Part 1: C++ Building Block Essentials
2. Chapter 1: Understanding Basic C++ Assumptions FREE CHAPTER 3. Chapter 2: Adding Language Necessities 4. Chapter 3: Indirect Addressing – Pointers 5. Chapter 4: Indirect Addressing – References 6. Part 2: Implementing Object-Oriented Concepts in C++
7. Chapter 5: Exploring Classes in Detail 8. Chapter 6: Implementing Hierarchies with Single Inheritance 9. Chapter 7: Utilizing Dynamic Binding through Polymorphism 10. Chapter 8: Mastering Abstract Classes 11. Chapter 9: Exploring Multiple Inheritance 12. Chapter 10: Implementing Association, Aggregation, and Composition 13. Part 3: Expanding Your C++ Programming Repertoire
14. Chapter 11: Handling Exceptions 15. Chapter 12: Friends and Operator Overloading 16. Chapter 13: Working with Templates 17. Chapter 14: Understanding STL Basics 18. Chapter 15: Testing Classes and Components 19. Part 4: Design Patterns and Idioms in C++
20. Chapter 16: Using the Observer Pattern 21. Chapter 17: Applying the Factory Pattern 22. Chapter 18: Applying the Adapter Pattern 23. Chapter 19: Using the Singleton Pattern 24. Chapter 20: Removing Implementation Details Using the pImpl Pattern 25. Part 5: Considerations for Safer Programming in C++
26. Chapter 21: Making C++ Safer 27. Assessments 28. Index 29. Other Books You May Enjoy

What this book covers

Chapter 1, Understanding Basic C++ Assumptions, provides a concise review of basic language features that are assumed knowledge within the book. Existing programmers can quickly grasp the language basics reviewed in this first chapter.

Chapter 2, Adding Language Necessities, reviews non-OO features that are critical C++ building blocks: const qualifiers, function prototyping (default values), and function overloading.

Chapter 3, Indirect Addressing – Pointers, reviews pointers in C++, including memory allocation/deallocation, pointer usage/dereferencing, usage in function arguments, void pointers, and introduces the concept of smart pointers.

Chapter 4, Indirect Addressing – References, introduces references as an alternative to pointers, including initialization, function arguments/return values, and const qualification.

Chapter 5, Exploring Classes in Detail, introduces OOP by first exploring OO and the concepts of encapsulation and information hiding, and then covers class features in detail: member functions, the this pointer, access labels and regions, constructors, destructor, and qualifiers on data members and member functions (const, static, and inline).

Chapter 6, Implementing Hierarchies with Single Inheritance, details generalization and specialization using single inheritance. This chapter covers inheriting members, the use of base class constructors, inherited access regions, order of construction/destruction, final classes, as well as public versus private and protected base classes, and how this changes the meaning of inheritance.

Chapter 7, Utilizing Dynamic Binding through Polymorphism, describes the OO concept of polymorphism and then distinguishes operation from method, details virtual functions and runtime binding of methods to operations (including how the v-table works), and differentiates the use of virtual, override, and final.

Chapter 8, Mastering Abstract Classes, explains the OO concept of abstract classes, their implementation using pure virtual functions, the OO concept of an interface and how to implement it, as well as up and down casting within a public inheritance hierarchy.

Chapter 9, Exploring Multiple Inheritance, details how to use multiple inheritance as well as its controversy in OO designs. This chapter covers virtual base classes, diamond-shaped hierarchies, and when to consider alternate designs by examining the OO concept of a discriminator.

Chapter 10, Implementing Association, Aggregation, and Composition, describes the OO concepts of association, aggregation, and composition and how to implement each concept using pointers, sets of pointers, containment, and sometimes references.

Chapter 11, Handling Exceptions, explains how to try, throw, and catch exceptions by considering many exception scenarios. This chapter shows how to extend an exception handling hierarchy.

Chapter 12, Friends and Operator Overloading, explains the proper use of friend functions and classes, and examines operator overloading (which may use friends) to allow an operator to work with user defined types in the same way it works with standard types.

Chapter 13, Working with Templates, details template functions and classes to genericize certain types of code to work with any data type. This chapter also shows how operator overloading can make selected code more generic for any type to further support the use of templates.

Chapter 14, Understanding STL Basics, introduces the Standard Template Library in C++ and demonstrates how to use common containers, such as list, iterator, deque, stack, queue, priority_queue, and map. Additionally, STL algorithms and functors are introduced.

Chapter 15, Testing Classes and Components, illustrates OO testing methods using the canonical class form and drivers to test classes, and shows how to test classes related through inheritance, association, and aggregation. This chapter also shows how to test classes that utilize exception handling.

Chapter 16, Using the Observer Pattern, introduces design patterns overall and then explains the Observer pattern, with an in-depth example illustrating the components of the pattern.

Chapter 17, Applying the Factory Pattern, introduces the Factory Method pattern and showcases its implementation with and without an Object Factory. It also compares an Object Factory to an Abstract Factory.

Chapter 18, Applying the Adapter Pattern, examines the Adapter pattern, providing strategies and examples utilizing inheritance versus association to implement the pattern. Additionally, this chapter demonstrates a wrapper class as a simple Adapter.

Chapter 19, Using the Singleton Pattern, examines in detail the Singleton pattern with a sophisticated paired-class implementation. Singleton registries are also introduced.

Chapter 20, Removing Implementation Details Using the pImpl Pattern, describes the pImpl pattern, which is used to reduce compile-time dependencies within code. A detailed implementation is explored using unique pointers. Performance issues are explored relating to the pattern.

Chapter 21, Making C++ Safer, revisits topics covered throughout the book, with the intention of identifying core programming guidelines that can be used to make C++ a safer language for the development of robust software.

Assessments contains all the answers to the questions from every chapter.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £16.99/month. Cancel anytime