I will describe what I am trying to do, and hopefully someone can tell me which design template this is or indicate the best alternative.
I have a method that does a bunch of complex things that involve approximation. You can calculate the result without approximation, but this is due to more work.
I want to make some comparisons related to the inner workings of an implementation. My idea is to pass in an object that will do this extra work and save the comparison information.
I think I want to go from:
class Classifier(object): ... def classify(self, data):
to
class TruthComparer(object): def compute_and_store_stats(self, data, accessory_data):
The reason I donβt want to do these comparisons inside the classify method is because I donβt think it matches the task of this method or object to perform these comparisons.
So, what design template, if any, is this? Can you suggest an alternative?
user334856
source share