This page intentionally left blank
C++ DESIGN PATTERNS AND DERIVATIVES PRICING
2nd edition
Design patterns are the cutting-edge paradigm for programming in object-oriented lan-
guages. Here they are discussed in the context of implementing financial models in C++.
Assuming only a basic knowledge of C++ and mathematical finance, the reader is taught
how to produce well-designed, structured, reusable code via concrete examples.
This new edition includes several new chapters describing how to increase robustness
in the presence of exceptions, how to design a generic factory, how to interface C++
with EXCEL, and how to improve code design using the idea of decoupling. Complete
ANSI/ISO compatible C++ source code is hosted on an accompanying website for the
reader to study in detail, and reuse as they see fit.
A good understanding of C++ design is a necessity for working financial mathemati-
cian; this book provides a thorough introduction to the topic.
Mathematics, Finance and Risk
Editorial Board
Mark Broadie, Graduate School of Business, Columbia University
Sam Howison, Mathematical Institute, University of Oxford
Neil Johnson, Centre for Computational Finance, University of Oxford
George Papanicolaou, Department of Mathematics, Stanford University
C++ DESIGN PATTERNS AN D
DERIVATIVES PRICING
M. S. J O S H I
University of Melbourne
CAMBRIDGE UNIVERSITY PRESS
Cambridge, New York, Melbourne, Madrid, Cape Town, Singapore, São Paulo
Cambridge University Press
The Edinburgh Building, Cambridge CB2 8RU, UK
Published in the United States of America by Cambridge University Press, New York
www.cambridge.org
Information on this title: www.cambridge.org/9780521721622
© M. S. Joshi 2008
This publication is in copyright. Subject to statutory exception and to the provision of
relevant collective licensing agreements, no reproduction of any part may take place
without the written permission of Cambridge University Press.
First published in print format
2008
ISBN-13 978-0-511-39693-9
eBook (NetLibrary)
ISBN-13 978-0-521-72162-2
paperback
Cambridge University Press has no responsibility for the persistence or accuracy of urls
for external or third-party internet websites referred to in this publication, and does not
guarantee that any content on such websites is, or will remain, accurate or appropriate.
To Jane