I’m an intermediate C#/ASP.net coder working on a fun MVC project. I’d like to implement an experiment framework that will allow objects to “jiggle” functionality in order to find better ways of doing things. Where can I read more about best practices or tutorials on this kind of thing?
e.g
// A helper class that might return different flavors of "mean".
public class MeanHelper
{
...
Mean(IEnumerable<double> input) { <shuffle between the 3 below.> }
OrdinaryMean(IEnumerable<double> input) { ... }
GeometricMean(IEnumerable<double> input) { ... }
HarmonicMean(IEnumerable<double> input) { ... }
...
}
Thanks so much!
What you describe sounds like a strategy pattern; you could for instance have an interface IMean, with a method Calculate, and 3 implementations.