
API Design for C++
by Martin Reddy
2nd Edition
Publisher: Morgan Kaufmann
Book Details
| Print ISBN | 9780443222191 |
| eText ISBN | 9780443222207 |
| Publisher | Morgan Kaufmann |
| Publishing Year | 2024 |
| Edition | 2nd Edition |
| Language | English |
| Pages | 648 |
API Design for C++, 2nd Edition, by Martin Reddy, provides thorough instruction on library interface creation and C++ programming. Targeted at senior undergraduate students, graduate students, software engineers, and academic or industry Computer Science researchers, this publication establishes methods for building reliable software interfaces. It details core structural strategies necessary for developing maintainable codebases in professional settings.
The coverage spans the complete API lifecycle, progressing from initial design and implementation to documentation, testing, release, versioning, ongoing maintenance, and deprecation. Across these stages, the book addresses key technical themes including interface design, plug-in extensibility, scripting interfaces, and performance optimization.
To support applied learning, the text includes functional code examples with working source code available online for experimentation. This practical orientation makes the work a strong fit for upper-level Computer Science and software engineering courses focused on component architecture and software design.
Table of Contents
Chapter 1: Introduction
- • What Are APIs?
- • What's Different about API Design?
- • Why Should You Use APIs?
- • When Should You Avoid APIs?
- • API Examples
- • File Formats and Network Protocols
- • About This Book
Chapter 2: Qualities
- • Model the Problem Domain
- • Hide Implementation Details
- • Minimally Complete
- • Easy to Use
- • Loosely coupled
- • Stable, Documented, and Tested
Chapter 3: Patterns
- • Pimpl Idiom
- • Singleton
- • Factory Methods
- • API Wrapping Patterns
- • Observer Pattern
Chapter 4: Design
- • A Case for Good Design
- • Gathering Functional Requirements
- • Creating Use Cases
- • Elements of API Design
- • Architecture Design
- • Class Design
- • Function Design
Chapter 5: Styles
- • Flat C APIs
- • Object-Oriented C++ APIs
- • Template-Based APIs
- • Data-Driven APIs
Chapter 6: C++ Usage
- • Namespaces
- • Constructors and Assignment
- • Const Correctness
- • Templates
- • Operator Overloading
- • Function Parameters
- • Avoid #define for Constants
- • Avoid Using Friends
- • Exporting Symbols
- • Coding Conventions
Chapter 7: C++ Revisions
- • Which C++ Revision to Use
- • C++11 API Features
- • Smart Pointers
- • Explicit Member Functions
- • Explicit Overrides and Final
- • Enum Classes
- • Function Objects
- • Tuples
- • Hash Tables
- • Constant Expressions
- • Null pointer constant
- • Type aliases with using
- • Unicode String Literals
- • C++14 API Features
- • The deprecated Attribute
- • More Relaxed Const Expressions
- • Binary Literals and Digit Separators
- • C++17 API Features
- • Nested Namespace Definitions
- • Inline Variables
- • Check for Header Availability
- • Function Exception Specifications
- • String Views
- • Optionals
- • Any Type
- • Variant Container
- • Byte Type
- • C++20 API Features
- • Modules
- • Template Constraints and Concepts
- • The Spaceship Operator
- • The consteval Specifier
- • Coroutines
- • Version Header
- • C++23 API Features
- • Conditional Preprocessor Directives
- • Multidimensional Subscript Operator
- • Expected Values
Chapter 8: Performance
- • Pass Input Arguments by Const Reference
- • Minimize #include Dependencies
- • Declaring Constants
- • Initialization Lists
- • Memory Optimization
- • Don't Inline Until You Need To
- • Copy on Write
- • Iterating over Elements
- • Performance Analysis
Chapter 9: Concurrency
- • Thread Safety
- • Avoiding Global Data
- • Returning Data by Value
- • The Use of static
- • Initialization of Data
- • Mutex Locking for Data Access
- • Using Async Functions
- • Promises and Futures
- • Producer Consumer API
Chapter 10: Versioning
- • Version Numbers
- • Software Branching Strategies
- • Life Cycle of an API
- • Levels of Compatibility
- • How to Maintain Backward Compatibility
- • API Reviews
Chapter 11: Documentation
- • Reasons to Write Documentation
- • Types of Documentation
- • Documentation Usability
- • Inclusive Language
- • Using Doxygen
Chapter 12: Testing
- • Reasons to Write Tests
- • Types of API Testing
- • Writing Good Tests
- • Writing Testable Code
- • Automated Testing Tools
Chapter 13: Objective C++ and Swift
- • Using Objective C++ within a C++ API
- • Objective C++ wrapper for C++ API
- • Using os_log and signposts
- • Accessing an Objective C++ API in Swift
Chapter 14: Scripting
- • Adding Script Bindings
- • Script Wrapping Technologies
- • Adding Python Bindings with Boost Python
- • Adding Ruby Bindings with SWIG
Chapter 15: Extensibility
- • Extending via Plugins
- • Extending via Inheritance
- • Extending via Templates
Customer Reviews
0.0
0 reviews
No reviews yet. Be the first to review this book!
Write a Review
Reviewed by GradeFocus Editorial Team
▶Research Sources (14)
- API Design for C++ - 2nd Edition - Elsevier Shop
- API Design for C++ [2 ed.] 0443222193, 9780443222191 ...
- Appendix A: Libraries - API Design for C++, 2nd Edition [Book]
- API Design for C++ - Martin Reddy (9780443222207) » Bokkilden
- API Design for C++ | Martin Reddy | 2. Auflage | 2024
- API Design for C++ - DOKUMEN.PUB
- 12. Testing - API Design for C++, 2nd Edition [Book] - O'Reilly
- Please verify you are human - Captcha
- API Design for C++ - ScienceDirect.com
- Opinions on API Design for C++ Book by Martin Reddy? - Reddit
- Modern C++ API Design [2019 Class Archive] - CppCon
- API Design for C++ by Martin Reddy - Boomerang Books
- Back to Basics: C++ API Design - Jason Turner - CppCon 2022
- C++ API Design - Medium





