Login  Register

Re: quantlib Handle compile error

Posted by Kim Kuen Tang on May 25, 2010; 6:36pm
URL: http://quantlib.414.s1.nabble.com/quantlib-Handle-compile-error-tp7722p7728.html

Kakhkhor Abdijalilov schrieb:
> I have another question. Doesn't Handle class duplicate the
> functionality of  shared_ptr? I understand, that RelinkableHandle has
> a whole new capability. *But what Handle class can do which shared_ptr
> can't?
> *
>  
Hi Kakhkhor,

as you know class Handle is there to implement the observer pattern.
Quoted from Wiki:The *observer pattern*  is a software design pattern
<http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29> in
which an object
<http://en.wikipedia.org/wiki/Object_%28computer_science%29#Objects_in_object-oriented_programming>,
called the subject, maintains a list of its dependants, called
observers, and notifies them automatically of any state changes, usually
by calling one of their methods
<http://en.wikipedia.org/wiki/Method_%28computer_science%29> ( in
quantlib this is the method update). It is mainly used to implement
distributed event handling systems.
> Consider 2 examples below. Why would one prefer Example 2 over Example
> 1? In my view, they are identical unless I am missing something.
>
>  


------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users