Understanding .NET (2nd Edition)

The CLR introduces many new ideas for Windows developers. To help tie together the concepts described in this chapter, Figure 2-13 shows a process running a CLR-based application.

Figure 2-13. Managed code, software built on the .NET Framework, relies on the CLR to provide many different services.

All CLR-based applications have much in common

The process includes a runtime host, a single app domain, and the CLR itself. Some of the CLR's more important components are shown, including the loader, the JIT compiler, and the garbage collector. Within the app domain, there's a single loaded assembly containing the three classes X, Y, and Z along with their metadata. Some methods in the classes have already been JIT-compiled, while others have not. And as the figure shows, variables of various value and reference types are in use by this running code. There's even some garbage on the heap waiting to be collected.

Creating software on the .NET Framework requires using the CLR, but it doesn't really require understanding how the CLR provides all of its services. Still, having a good conceptual model of what's going on will help in understanding how .NET Framework applications work. This knowledge will help you make better choices and build better applications using the .NET Framework.

Understanding the CLR is important

Категории