Posted by
johan bosaeus-2 on
Dec 27, 2001; 10:12am
URL: http://quantlib.414.s1.nabble.com/QuEP-5-using-replaceable-pricing-engines-tp1827.html
Hi,
My first impression is that it is really good. Nice "pattern-thinking". A
possible extension could be
to make use of an abstract factory (Gang of Four, Design Patterns), in order
to create "sets" of
<parameter, result, engine and instrument> objects. For example, one
subclass of such a factory
could be "EuropeanOptionWithXXEngineFactory". The create() method of that
class should create
all relevant objects and "link" them together the way you describe. What do
you think? I like using
the "Prototype pattern" also to provide object "sets" for an application.
You are using "degenerated" base classes for arguments and results. Have you
considered using a
template as the engine subclass instead. Where the template parameters
indicate which type of
parameters and results you are using as "strategies"? It's just an
alternative, which, of my
knowledge, is used extensively. (For example in ACE/TAO
(www.cs.wustl.edu/¨schmidt)).
Nice suggestion indeed,
/Johan
Bosaeus
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx