API Design for C++
- 1st Edition - February 4, 2011
- Author: Martin Reddy
- Language: English
- Paperback ISBN:9 7 8 - 0 - 1 2 - 3 8 5 0 0 3 - 4
- eBook ISBN:9 7 8 - 0 - 1 2 - 3 8 5 0 0 4 - 1
API Design for C++ provides a comprehensive discussion of Application Programming Interface (API) development, from initial design through implementation, testing, docume… Read more
Purchase options
Institutional subscription on ScienceDirect
Request a sales quote- The only book that teaches the strategies of C++ API development, including design, versioning, documentation, testing, scripting, and extensibility
- Extensive code examples illustrate each concept, with fully functional examples and working source code for experimentation available online
- Covers various API styles and patterns with a focus on practical and efficient designs for large-scale long-term projects
- Foreword
- Preface
- Why you should read this book
- Who is the target audience
- Focusing on C++
- Conventions
- Book web site
- Acknowledgments
- Author Biography
- Chapter 1. Introduction
- Publisher Summary
- 1.1 What are Application Programming Interfaces?
- 1.2 What's Different About API Design?
- 1.3 Why Should you Use APIs?
- 1.4 When Should you Avoid APIs?
- 1.5 API Examples
- 1.6 File Formats and Network Protocols
- 1.7 About this Book
- Chapter 2. Qualities
- Publisher Summary
- 2.1 Model the Problem Domain
- 2.2 Hide Implementation Details
- 2.3 Minimally Complete
- 2.4 Easy to Use
- 2.5 Loosely Coupled
- 2.6 Stable, documented, and tested
- Chapter 3. Patterns
- Publisher Summary
- 3.1 Pimpl Idiom
- 3.2 Singleton
- 3.3 Factory Methods
- 3.4 API Wrapping Patterns
- 3.5 Observer Pattern
- Chapter 4. Design
- Publisher Summary
- 4.1 A Case for Good Design
- 4.2 Gathering Functional Requirements
- 4.3 Creating Use Cases
- 4.4 Elements of Api Design
- 4.5 Architecture Design
- 4.6 Class Design
- 4.7 Function Design
- Chapter 5. Styles
- Publisher Summary
- 5.1 Flat C APIs
- 5.2 Object-oriented C++ APIs
- 5.3 Template-based APIs
- 5.4 Data-driven APIs
- Chapter 6. C++ Usage
- Publisher Summary
- 6.1 Namespaces
- 6.2 Constructors and Assignment
- 6.3 Const Correctness
- 6.4 Templates
- 6.5 Operator Overloading
- 6.6 Function Parameters
- 6.7 Avoid #define for Constants
- 6.8 Avoid Using Friends
- 6.9 Exporting Symbols
- 6.10 Coding Conventions
- Chapter 7. Performance
- Publisher Summary
- 7.1 Pass Input Arguments by Const Reference
- 7.2 Minimize #include Dependencies
- 7.3 Declaring Constants
- 7.4 Initialization Lists
- 7.5 Memory Optimization
- 7.6 Don’t Inline Until You Need To
- 7.7 Copy on Write
- 7.8 Iterating Over Elements
- 7.9 Performance Analysis
- Chapter 8. Versioning
- Publisher Summary
- 8.1 Version Numbers
- 8.2 Software Branching Strategies
- 8.3 Life Cycle of an API
- 8.4 Levels of Compatibility
- 8.5 How to Maintain Backward Compatibility
- 8.6 API Reviews
- Chapter 9. Documentation
- Publisher Summary
- 9.1 Reasons to Write Documentation
- 9.2 Types of Documentation
- 9.3 Documentation Usability
- 9.4 Using Doxygen
- Chapter 10. Testing
- Publisher Summary
- 10.1 Reasons to Write Tests
- 10.2 Types of API Testing
- 10.3 Writing Good Tests
- 10.4 Writing Testable Code
- 10.5 Automated Testing Tools
- Chapter 11. Scripting
- Publisher Summary
- 11.1 Adding Script Bindings
- 11.2 Script-binding Technologies
- 11.3 Adding Python Bindings With Boost Python
- 11.4 Adding Ruby Bindings With Swig
- Chapter 12. Extensibility
- Publisher Summary
- 12.1 Extending Via Plugins
- 12.2 Extending Via Inheritance
- 12.3 Extending Via Templates
- Appendix A. Libraries
- A.1 Static Versus Dynamic Libraries
- A.2 Libraries on Windows
- A.3 Libraries on Linux
- A.4 Libraries on Mac Os X
- Bibliography
- Index
- No. of pages: 472
- Language: English
- Edition: 1
- Published: February 4, 2011
- Imprint: Morgan Kaufmann
- Paperback ISBN: 9780123850034
- eBook ISBN: 9780123850041
MR
Martin Reddy
Dr. Martin Reddy holds a Ph.D. in Computer Science and has over 30 years of experience in the software industry. He is a Fellow of the IEEE, a Fellow of the AAIA, and a Distinguished Member of the ACM. He has published 10 patents, over 40 professional articles, and 2 books. Martin was co-founder and CTO of the AI startup, PullString, where he oversaw the development of the company's technology until it was acquired by Apple in 2019. While at Apple, Martin was a software architect responsible for the architecture and APIs of major components of the Siri virtual assistant. Before that, Dr. Reddy worked for 6 years at Pixar Animation Studios where he was a lead engineer for the studio's in-house animation system. He worked on several Academy Award Winning and Nominated films, such as "Finding Nemo", "The Incredibles", "Cars", "Ratatouille", and "Wall-E". He was also the hair model for Mr Incredible. Martin began his career at SRI International where he worked on a distributed 3D terrain visualization system and co-authored the geospatial functionality in the VRML and X3D ISO standards. Martin was awarded Alumnus of the Year by his alma mater, Strathclyde University.