March 6th, 2013, 10:31 am
I am writing a class to represent a pool of securities to be used in a portfolio selector. Depending on the objective metric and constraints, the class objects will cache some relevant data for performance optimization. This could be done by defining a base class containing the common elements and its sub classes, each optimized for a particular objective metric/constraints.But, I want the ability to cache data for multiple metrics. Is there a standard/neat way to do this?