.NET Framework - based applications (Framework applications) are programs that require the.NET Framework to run. For the purposes of this book we will refer to these applications as Framework applications.
The elements of a Framework application are generally split into multiple logical layers which handle the different pieces of functionality. Those logical
Some Framework applications make use of Web services to connect to other applications or services. These are often given the
You can create Framework applications using a variety of development environments, but for the purposes of this book, we assume that you are using Visual Studio .NET 2003.
The .NET Framework is an object-oriented programming platform that
To provide a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely.
To provide a code-execution environment that minimizes software deployment and versioning conflicts,
To make the developer experience consistent across widely varying types of applications, such as Windows-based applications and Web-based applications.
To build all communication on industry standards to ensure that code based on the .NET Framework can integrate with other code.
The Common Language Runtime (CLR) is the foundation of the .NET Framework. Think of the runtime as an agent that
The CLR also enforces strict type safety and other forms of code accuracy that ensure security. Thus, it is important to know how well the CLR is operating as this has a direct effect on your applications.
The following diagram shows how the Common Language Runtime underpins the architecture of .NET Framework-based applications.
Figure 1.2: Architecture of .NET Framework-based applications
Any code which uses the Framework is known as managed code and can use the core services by executing under the runtime. Code that does not use the Framework is known as unmanaged code.
To run managed code on a computer, the .NET Framework must be installed on that computer.
Using the managed environment of the runtime eliminates many common software issues. For example, the runtime automatically handles object layout and manages references to objects, releasing them when no longer in use. This automatic memory management helps to resolve the two most common application errors of memory leaks and invalid memory references.
The runtime also enforces code robustness by implementing a strict type- and code-verification infrastructure called the common type system (CTS). CTS ensures that all managed code is
The CLR design supports a variety of different types of applications, from Web server applications to programs with a traditional rich Microsoft Windows operating system user interface. Each type requires a runtime host to start the application. The runtime host loads the runtime into a process, creates the application domains within the process, and loads
The .NET Framework class library is a comprehensive, object-oriented collection of reusable classes, interfaces, and types that you can use to develop applications. The classes provide access to system functionality such as:
Graphical user interface (GUI) elements
Enterprise services (such as message queuing, load balancing, and transacted
File input and output
The .NET Framework types are the foundation on which Framework applications, components, and controls are built. The .NET Framework includes types that perform the following functions:
Represent base data types and exceptions.
Encapsulate data structures.
Access information about loaded types.
Invoke .NET Framework security checks.
Provide data access, rich client-side GUI, and
The .NET Framework provides a rich set of interfaces, as well as abstract and concrete (non-abstract) classes. You can use the concrete classes as is or, in many cases, derive your own classes from them. To use the functionality of an interface, you can either create a class that implements the interface or derive a class from one of the .NET Framework classes that implements the interface.
Code that uses any of the classes from the .NET Framework class library requires the .NET Framework be installed on the computer on which it runs.