Information Technology Reference
In-Depth Information
public string LastName
{
get
{
CheckState();
return lastName;
}
set
{
CheckState();
lastName = value ;
CheckState();
}
}
If not, you get this:
public string LastName
{
get
{
return lastName;
}
set
{
lastName = value ;
}
}
The body of the CheckState() function is the same, regardless of the state
of the environment variable. This is one example of why you need to
understand the distinction made between the compilation and JIT steps in
.NET. Whether the DEBUG environment variable is defined or not, the
CheckState() method is compiled and delivered with the assembly. That
might seem inefficient, but the only cost is disk space. The CheckState()
function does not get loaded into memory and JITed unless it is called. Its
presence in the assembly file is immaterial. This strategy increases flexi-
bility and does so with minimal performance costs. You can get a deeper
understanding by looking at the Debug class in the .NET Framework. On
any machine with the .NET Framework installed, the System.dll assembly
does have all the code for all the methods in the Debug class. Environment
 
Search WWH ::




Custom Search