8.1 DESIGN SCOPE

The pricing tool is designed with one fundamental principle in mind –extensibility, which is scalability in terms of product and model definitions. Extensibility of this kind is achieved using a completely modular approach to model implementation. To the pricing tool, every pricing model is a dynamic link library (DLL) that exposes a set of functions with rigidly defined signatures. The only interaction between the pricing tool and the pricing model that evaluates a product is through these functions. Thus, the pricing tool simulates the façade pattern, although it is not implemented using the traditional object-oriented paradigm.

The rigid definition of the pricing function allows the pricing tool automatically to write a C++ file implementing the model and product as we define them interactively. Once the skeleton program is generated all we have to do is to insert the code implementing the pricing method and make a DLL out of it. The pricing tool will then load the DLL and use it as needed. Thus, we can extend the functionality of the pricing tool on the fly without even recompiling it. In fact, we do not even have to exit from the program to add a new product and/or model. Once added, the new product can be analysed using all the features in the pricing tool (the Greeks computation, plotting, etc.) without writing a single line of extra code for it.

The modular separation between the pricing method and the rest of the program in the pricing tool makes it easy ...

Get Principles of Quantitative Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.