
78 Chapter 2 • The Microsoft .NET Framework
Weak references can provide a workaround when you are dealing with
memory-intensive objects and avoid the cost of constantly recreating and reini-
tializing objects. Imagine an object that traverses a database and stores a set of
sorted fields. If the database is small enough, it can rest in memory without
problem. However, if the database is large, we run the risk of over loading our
resources every time we have to create a new one. Using a weak reference, we
can bypass having to create a new object and redoing the sort by keeping the
items we need on standby.You can then recreate the strong reference by pointing ...