Use translates, roughly speaking, into:
Something mySomething = new Something();
try
{
something.someProp = "Hey";
}
finally
{
if(mySomething != null)
{
mySomething.Dispose();
}
}
And that is pretty much the case. The goal is to support deterministic deletion, something that C # does not have, because it is a garbage collection. Data usage / deletion patterns give programmers the ability to specify exactly when a type cleans up its resources.
source
share