. Applications written on top of the CLR do not need toexplicitly allocate and free system memory. Handling your own memorymanagement can be complex and time consuming. In fact,
memorymanagement is one of the most common sources of bugs and securityvulnerabilities in today’s applications
. Without having to worry about memorymanagement, developers are able to be more productive, write more robustcode, and focus on solving their own problems.
. Managed code is code that executes on top of the CLR. It’scalled managed code because the CLR takes care of, or manages, the code’sexecution, such as requests for system memory and the application of codeaccess security policies.
Why the .NET Framework?
The .NET Framework was designed with one key goal in mind:
to increase theproductivity of software developers
. This goal is accomplished through a number of features that are built into the framework. Understanding these features will help youmaximize your development efforts when using the .NET Framework.
APIs in the .NET Framework are encapsulated in classes
. A class in theframework usually
contains members such as properties and methods
create an instance of a class
in the framework and use it to perform tasks that arerequired by the application. Developers can also
extend classes to include additionalbehaviors or combine them to define new classes
. This object-oriented approachoffers a familiar model that you can quickly identify with and relate to as you explore thefunctionality exposed by the framework.
The classes that make up the .NET Framework are layered, meaning that at the base of the framework are
, which are built on and reused by more
. The more complex types often provide the ability to perform more significantoperations. For example, the socket class provides raw access to the network. Theamount of code that you might write when using the socket class to download a filefrom the Internet might be 50 lines. The HTTP classes in the framework build on top of the socket class and make it easier to perform the same task. For example, theexample that downloads a file from the Internet could now be accomplished in 15 linesof code. More generic URI resolution classes make it possible to download the samefile in one or two lines of code. This layered approach makes it possible to use theclasses that are most applicable to the task your application needs to accomplish.Because one layer builds on top of the other, it also makes it possible for an applicationto use the higher levels to do most of the work without blocking the ability to access thelower levels for maximum control.
.NET Framework Classes