Ask Question         Q & A         Articles        
Skip Navigation LinksHome > Articles > Article Detail

The .NET FRAMEWORK

 By : Sandeep Sharma   |  Views : 152220
0 0 0 0 0

The .NET infrastructure consists of all the technologies that help in creating and running robust, scalable, and distributed applications.  The core of the .NET infrastructure is the .NET Framework, which is a collection of services and classes. It exists as a layer between .NET applications and the underlying operating system.  In other words, the .NET Framework encapsulates much of the basic functionality that was earlier built into various programming languages, such as debugging such as debugging and security services.

Components of the .NET Framework

 The .NET Framework consists of Web Forms, Windows Forms, and Console application that pertain to the presentation layer of an application.  Web Forms are used in Web-based applications, whereas Windows Forms are used in Windows-based applications for providing an interactive user interface.  In addition, you can create character-based console applications that can be executed from the command line.  Beside these three components, the .NET Framework consists of two other components, the .NET Framework Base Classes and the Common Language Runtime (CLR).  Let us look at these two components in detail.

 The .NET Framework Base Classes or the .NET Class Framework

 The .Net Class Framework consists of a class library that works with any .NET language, such as Visual Basic .NET and C#.  This class library is built on the object-oriented nature of the runtime.  It provides classes that can be used in the code to accomplish a range of common programming tasks, such as string management, data collection, database connectivity, and file access.  One of the most important features of the .NET Framework class library is that it can be used in a consistent manner across multiple languages.  This means that you can use the same set of classes for performing a specific task in Visual Basic as well as in Visual C++.  This not only makes the .NET Framework types easy to use but also simplifies the learning curve associated with using a new piece of code.

 The .NET Framework class library comprises namespaces, which are contained within assemblies.  Let us look at what these two terms mean.

 Namespaces

 Namespaces help you to logical groups of related classes and interfaces that can be used by any language targeting the .NET Framework.  Namespaces allow you to organize your classes so that they can be easily accessed in other applications.  Namespaces can also be used to avoid any naming conflicts between classes that have the same names.  For example, you can use two classes with the same name in an application provided they belong to different namespaces.

Assemblies

An assembly is a single deployable unit that contains all the information about the implementation of classes, structures, and interfaces.  An assembly stores all the information about itself.  This information is called metadata and includes the name and version number of the assembly, security information, information about the dependencies, and a list of the files that constitute the assembly.  All the applications developed using the .NET Framework are also made up of assemblies.  Namespaces are also stored in assemblies.  Assemblies and the metadata provide the CLR with the information required for executing an application.  For example, if an application uses a component, the assembly keeps track of the version number of the component used in the application.  The assembly provides this information to the CLR while the application is being executed.  Assemblies also play an important role in deployment and versioning.  You will learn more about assemblies in Lesson 3.

The Common Language Runtime (CLR)

The Common Language Runtime is one of the most essential components of the .NET Framework.  The CLR or the runtime provides functionality such as exception handling, security, debugging, and versioning support to any language that targets it.  This means that the runtime can host a variety of languages and offer a common set of tools across these languages, ensuring interoperability between the codes.  The existing runtime environment do not provide this capability.  For example, the Visual Basic runtime provided in the earlier versions can execute only Visual Basic programs.  In contrast to this, the CLR can execute programs written in any language.  Presently, the premier languages for the CLR are Visual Basic, C# (C Sharp), and C++ with managed extensions.  The compiler of any of these languages compiles the code to avail the services offered by the CLR.  There are a number of third-party compilers, such as Eiffle and COBOL compilers, which expose the functionality provided by the CLR.  You can use these compilers to write code that runs in the managed execution environment provided by the CLR.  The code that is developed with a language compiler that targets the CLR is called managed code.  On the other hand, the code that is developed without considering the conventions and requirements of the common language runtime is called unmanaged code.  Unmanaged code executes in the common language runtime environment with minimal services.  For example, unmanaged code may run with limited debugging and without the garbage collection process.

The garbage collection process manages the allocation and deallocation of memory for an application.  Whenever you create an object, the CLR allocates memory for the object from the managed heap.  The managed heap is a region with one or more pages of reserved address spaces that can be subdivided and allocated in smaller chunks.  If the CLR is unable to locate sufficient memory on the managed heap, it invokes the garbage collection process.  The garbage collection process runs through all objects and terminates objects that are no longer used by any application.

Liked this Article? Share with your Friends.
Related Content
arrow  .NET Revolution  
arrow  ASP.NET Is Compiled, Not Interpreted  
arrow  ASP.NET Questions  
arrow  Common Language Runtime- ASP.NET  
arrow  Advantages and disadvantages of ASP.NET  
arrow  .Net technology a revolutionary technology by Microsoft  
Comments
can u plz add the difference between window based .net and web based .net framework
Post Comment
Ask a Question