Concept: Object tracker

An object tracker is an object which tracks the lifetimes of other objects.

An object tracker has two responsibilities:
These responsibilities are not handled by the object tracker; they are delegated to the object ID and object ID reference types:
  • Checking if the target is still alive, or retrieving a strong reference to the target.
  • Registering callbacks that are invoked some time after the target is garbage collected.

If an object tracker is requested to track the same target twice, it will return the same object ID for both of those requests. Because of this, an object tracker can only track reference-equatable instances.

In the Nito.Weakness library, there is only one object tracker per AppDomain: the static Default property of the ObjectTracker class.

Last edited Jul 23, 2010 at 7:32 PM by shammah, version 5


No comments yet.