|
From: Ferdinando A. <na...@am...> - 2008-03-07 10:14:24
|
Hi Tasos it might help to know in more details what kind of problems you had, otherwise it is harder to provide feedback about your suggestions. Anyway I anticipate my guess/suggestion. You might write your own CADSwapHelper deriving from RateHelper or SwapHelper and and wrap in that RateHelper your custom Swap. The VanillaSwap is just an helper class, for fully customized swap you should use the Swap class. Finally: if you can contribute your modifications they could go in the code base and you would not have to apply them to each release ;-) ciao -- Nando On Thu, Mar 6, 2008 at 7:10 PM, a akpitidis <a_a...@ya...> wrote: > 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. > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > > |