Login  Register

Re: [Quantlib-users] Two design questions about quantlib

Posted by Luigi Ballabio on Sep 24, 2012; 8:36am
URL: http://quantlib.414.s1.nabble.com/Two-design-questions-about-quantlib-tp13583p13585.html

Hi David,
    apologies for the delay.

You've put your finger on a sore spot.  It has been bugging me for a
while that it's just not possible to get a simple price without
instantiating an instrument and a pricing engine.  And of course, all
this comes from the pervasiveness of Observer.  Like the Vorlons in
Babylon 5, we thought we were doing good but ended up meddling with
people...

I have been thinking of trying to extract the functional core, so that
the basic pricing functions are available as functions (which is, I
guess, what you're driving at when you talk of implementing them as
Singletons) and the pricing-engine classes call the functions and take
care of observability.  For simple functionality, this could be done
in a backward-compatible way as to avoid code divergence.  I'm not
sure how this would work out in more complex cases, where the event
chains are more tangled.  And while this would be simple for engines,
I've a feeling that it would be difficult to do for things like term
structures, where it's more difficult to extract the functionality
from the object responding to events.

Another possibility would be to allow one to choose whether any given
object should listen to events or not.  But this can get messy very
quickly.

I guess what I'm trying to say is that I don't have a clear picture of
where to go :)
If anybody wants to weigh in, please do so.  I'd be nice to have a bit
of discussion on this.

Later,
    Luigi


On Mon, Sep 3, 2012 at 10:22 PM, David Eaves <[hidden email]> wrote:

> (html didn't post well before, re-posting both quantlib-dev and quantlib-users)
>
> I've been writing quant software for almost 20 years, and this is my first look at quantlib. It's very impressive, but I have two design questions that I wanted to float in the quantlib-dev list, and see what kind of thoughtful responses there might be. No need to respond instantly: I'd like to hear considered responses.
>
> This is all descended from the Observer design pattern, plus some other support. Which is nice, I did a bunch of event-driven systems back in the 1990s, very cool. And it scales reasonably well, within a single OS and machine.
>
> 1) Poll: How many users/developers have ever wanted to use this product without the Observer design pattern, which I find impedes distributed computing, general transparency, and audit?
>
> 2) Has anybody thought about how one might implement the subject matter independently, as Singleton, and embed it within a design pattern of ones own choosing? E.g. I'd like to be able to use these methods in a Command/Visitor context, but see a rewrite as codebase divergence, a big no-no for me.
>
> Thanks,
>
> Dave Eaves
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev