Multiparadigm Design in C++ - Duffy, Daniel J (Financial Instrument Pricing Using C++, 2018)
This chapter discusses the integration of modern features in C++ with object‐oriented design techniques. The goal is to design robust and flexible classes in C++. The chapter first explores two modelling techniques; the Liskov substitution principle (LSP); and the single responsibility principle (SRP). It then discusses how to design classes. In doing so, the chapter introduces a number of language features that improve the robustness and reliability of C++ classes and member functions. It also focuses on the different ways to construct objects and to initialise data. The features are tactical in the sense that they help to improve code quality at class level. Then, the chapter discusses different ways to achieve polymorphic behaviour in classes and class hierarchies. It finally gives an overview of object‐oriented software metrics that measure code quality by providing metrics for classes, their members as well as class hierarchies.