Utilizing remove text parametric type for the stock trading app

In the trading application we described previously, we could utilize parametric types to simplify the code and make it more reusable when adding future trading instruments.

It is quite clear that SingleStockTrade and SingleStockOptionTrade are almost the same. In fact, even the function definitions of sign and payment are identical. In this very simple example, we only have two functions for each type. In practice, we could have many more functions, and it would become quite messy.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.78.102