OONumerics User :

From: Georg Holzmann (grh_at_[hidden])
Date: 2007-09-21 05:26:36


Hallo!

I have the following problem: In my class (= an algorithm) I have data
and some algorithms and it should be possible to exchange the algorithms
- perfect would be at runtime.

So usually one would maybe use the strategy design pattern for such a
problem.
However, I want to avoid virtual functions (performace critical methods)
and so it is unfortunately not possible with strategy (?) - yes, one can
implement strategy with early binding (with mixins or e.g. the Curiously
Recurring Template Pattern), but I want late binding if possible ...

Has anyone an idea which other approach I could try ?
I also thought about function pointers (or FastDelegates as e.g.
described here: http://www.codeproject.com/cpp/FastDelegate.asp), but
then its not such a nice OO design ...

Thanks for any hint,
LG
Georg