|
From: a a. <a_a...@ya...> - 2008-03-06 18:11:08
|
Hi ,
I tried to add to 8.0 the CAD vanilla swaps for the curve building and i came across with some design issues, mainlly because i don't want to change existing modules of the library. However, i want to reuse most of the core code.
It turn out that i have no option but i need to either change existing modules or replicate existing code to new modules.
In my mind someone who wants to extend a library shouldn't have to change existing files, but the library needs to provide the appropriate hooks (i.e. interfaces, template classes/functions and so on). At the same time, as we all know, that takes time and effort, and in the main time the DIY solution fits most clients :).
Here are some sugestions for the future:
1. Create a template class VanillaSwapG ( G for generic), the coupontype should be the template parameters and they should be propagated down to the construction of the floating leg.
2. A typedef will define the existing VanillaSwap class.
3. Those template arguments should be propagated upwards to MakeVanillaSwap and SwapRateHelper.
4. Finally, i need to be able to hook my own code into the
SwapRateHelper::initializeDates as i need to set the custom floating leg tenor, which is different from the index tenor. Then again that extra information needs to come from somewhere, but then i need to have my new SwapRateHelper class, but i don't want to copy existing code.
Any thoughts?
Who decides what changes go into repository?
I really like the library, but i need to be able to enhance it, so it does what i want to do and at the same time i don't want to redo the changes everytime a new release comes up.
Regards
Tasos
---------------------------------
Sent from Yahoo! Mail.
The World 's Favourite Email. |