[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

careful caching

I moved all the a`caching algorithms from CanopyCrums into the
CanopyCache class.  In doing do, I noted that we have to be very
careful to maintain clean modularity boundaries in our caches.  The
pre-existing canopy cache essentially only contained state and a whole
bunch of accessing methods.  The actual algorithms to cache the
positions were implemented in CanopyCrum and they operated by pulling
a table out of the CanopyCache and side-effecting it!  Yech!  This
lack of modularity led to a creep of similar code into various other
places in the CanopyCrum (mostly protected methods, thankfully).

Modularity boundaries for caches are vitally important because caches
tend to cross boundaries within our abstractions.  If we aren't
careful and clean, they will quickly wire themselves inseparably into
the algorithms.