Re: Instruments, Arguments, Results and Pricing Engines
Posted by
Luigi Ballabio-2 on
Sep 11, 2003; 3:09am
URL: http://quantlib.414.s1.nabble.com/Policy-Based-Design-Templates-Quantlib-tp2601p2604.html
Hi Neil,
At 03:57 PM 9/4/03 +0100, Neil P Firth wrote:
>I need some guidance on the separation of concerns of the different
>directories. I think that it would be cleanest if all enum declarations
>(for OptionType, BarrierType, CapFloor::Type) were in the same location.
Hmm, except for the fact that e.g., Option::Type lives inside Option and
CapFloor::Type inside CapFloor... there's hope, but I don't think I'm
tackling this right now.
>It would also make sense if we had a pattern for the declarations for
>Arguments and Results, currently some are in with the Instruments, and
>some are in with the PricingEngines.
>
>I suggest that the Instruments have 'ownership' of their Arguments and
>Results, as there may be many Engines for each Instrument (I realise it is
>actually a many-to-many relationship). This would mean, for example,
>moving the VanillaOptionArguments from vanillaengines.hpp to
>vanillaoption.hpp. There should then be no references to specific
>PricingEngines in the Instruments.
Yes, I second that. Incidentally, this also goes towards moving the engine
machinery up to the Instrument class (right now it's in Option only.)
I guess I'll have to see whether there's some way to abstract the
instrument/arguments/result/engine thing so that it's easier to declare...
Later,
Luigi