Some feature observers don't implement the update() method. For these observers, it would be highly beneficial if they only compute the initialize_features() method once the user calls it.
Observers that would benefit from lazy evaluation are:
CompositeFeatureObserver
IsCompletedObserver
IsReadyObserver
Implementation suggestion:
For lazy evaluation, these observers could:
- Mark features as "dirty" when
update() is called
- Only recompute features in
initialize_features() when they're accessed and marked as dirty
- Clear the dirty flag after recomputation
This probably should be the FeatureObserver default behavior, since it already implements the update() method as simply calling initialize_features(). In other words, we should change this class instead of the mentioned ones directly. For IsCompletedObserver we should remove the unnecessary definition of its update() method.
Tasks
Some feature observers don't implement the
update()method. For these observers, it would be highly beneficial if they only compute theinitialize_features()method once the user calls it.Observers that would benefit from lazy evaluation are:
CompositeFeatureObserverIsCompletedObserverIsReadyObserverImplementation suggestion:
For lazy evaluation, these observers could:
update()is calledinitialize_features()when they're accessed and marked as dirtyThis probably should be the
FeatureObserverdefault behavior, since it already implements theupdate()method as simply callinginitialize_features(). In other words, we should change this class instead of the mentioned ones directly. ForIsCompletedObserverwe should remove the unnecessary definition of itsupdate()method.Tasks
FeatureObserverclassIsCompletedObserver'supdate()method