7.3 Designing classes with lots of processing
Some of the time, an object will contain all of the data that defines its internal state. There are cases, however, where a class doesn’t hold the data, but instead is designed to consolidate processing for data held in separate containers.
Some prime examples of this design are statistical algorithms, which are often outside the data being analyzed. The data might be in a built-in list or Counter object; the processing is defined in a class separate from the data container.
7.3.1 Getting ready
It’s quite common to do analysis on data that’s already been summarized into groups or bins. We might, for example, have a vast data file with a large number of measurements of an industrial process.
For background, see the NIST Aerosol Particle Size case study: https://www.itl.nist.gov/div898/handbook/pmc/section6/pmc62.htm
Rather than analyze the voluminous raw...