7.10 Using properties for lazy attributes
In the Designing classes with lots of processing recipe, we defined a class that eagerly computed a number of attributes of the data in a collection. The idea there was to compute the values as soon as possible, so that the attributes would have no further computational cost.
We described this as eager processing, since the work was done as soon as possible. The other approach is lazy processing, where the work is done as late as possible.
What if we have values that are used rarely, and are very expensive to compute? What can we do to minimize the up-front computation, and only compute values when they are truly needed?
7.10.1 Getting ready...
For background, see the NIST Aerosol Particle Size case study: https://www.itl.nist.gov/div898/handbook/pmc/section6/pmc62.htm
See the Designing classes with lots of processing recipe in this chapter for more details on this dataset. Rather...