Object-Oriented Programming

Early-objects approach. The book introduces the basic concepts and terminology of object technology in Chapter 1. You’ll develop your first customized C++ classes and objects in Chapter 3.

C++ Standard Library string. C++ offers two types of strings—string class objects (which we begin using in Chapter 3) and C strings (from the C programming language). We’ve replaced most occurrences of C strings with instances of C++ class string to make programs more robust and eliminate many of the security problems of C strings. We discuss C strings later in the book to prepare you for working with the legacy code in industry. In new development, you should favor string objects.

C++ Standard Library array. Our primary treatment of arrays now uses the Standard Library’s array class template instead of built-in, C-style, pointer-based arrays. We also cover built-in arrays because they still have some uses in C++ and so that you’ll be able to read legacy code. C++ offers three types of arrays—class templates array and vector (which we start using in Chapter 7) and C-style, pointer-based arrays which we discuss in Chapter 8. As appropriate, we use class template array and occasionally, class template vector, instead of C arrays throughout the book. In new development, you should favor class templates array and vector.

Crafting valuable classes. A key goal of this book is to prepare you to build valuable reusable C++ classes. In the Chapter 10 case study, you’ll build your own custom Array class. Chapter 10 begins with a test-drive of class template string so you can see an elegant use of operator overloading before you implement your own customized class with overloaded operators.

Case studies in object-oriented programming. We provide case studies that span multiple sections and chapters and cover the software development lifecycle. These include the GradeBook class in Chapters 37, the Time class in Chapter 9 and the Employee class in Chapters 1112. Chapter 12 contains a detailed diagram and explanation of how C++ can implement polymorphism, virtual functions and dynamic binding “under the hood.”

Optional case study: Using the UML to develop an object-oriented design and C++ implementation of an ATM. The UML™ (Unified Modeling Language™) is the industry-standard graphical language for modeling object-oriented systems. We introduce the UML in the early chapters. Chapters 22 and 23 include an optional case study on object-oriented design using the UML. We design and implement the software for a simple automated teller machine (ATM). We analyze a typical requirements document that specifies the system to be built. We determine the classes needed to implement that system, the attributes the classes need to have, the behaviors the classes need to exhibit and we specify how the classes must interact with one another to meet the system requirements. From the design we produce a complete C++ implementation. Readers often report that the case study “ties it all together” and helps them achieve a deeper understanding of object orientation.

Exception handling. We integrate basic exception handling early in the book. You can easily pull more detailed material forward from Chapter 17, Exception Handling: A Deeper Look.

Key programming paradigms. We discuss object-oriented programming and generic programming.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.174.0