c++ design patterns and derivative pricing