Sunday, August 19, 2007

Lets know about .NET

The MicroSoft.net framework is a new computing plateform that simplifies Application Development for a heighly Distributed enviornment even Internet.
The .net framework is designed to fulfill the following object.
*To provide a consistent object-oriented programming environment.
*To provide a code-execution environment that:
-minimum software deployment and versonning conflict
-gaurantees safe code execution
-Elimination the performance problem of scripted or interpreted environment
-makes developer experience conflict across widely varying types of application.

*To build all communication on industrystandards, to ensure that code based on the .net framework can integrate with any other code.
The .net framework has two main components:
#The CLR(Common Language Run-Time)
#The .NET Framework LIbrary


The CLR is the foundation of the .net framework. The code that targets the run time is known as managed code. While the code that does not target the run-time s known as unmanaged code.
The .net framework can be used to develop the following type of application and services:


-Console Application.
-Windows GUI application (windows forms)
-ASP .NET Application
-XML Web Services
-Windows Services
-Services Components


MS.NET provide the following Services:

*Run-time environment, the .net framework

*Progarmming model for constructing HTML pages, named ASP.NET

*XML web services- A new way for internet services to expose function to any client

*windows forms- Anew way of writing Rich Client Application Using ther .NET framework

ADO.NET, which provide good support for database access within the .NET framework.

*Support for handling XMLDocuments and Streams.

*Standardized mechanism for signaling asyncronous events.

*Support for writing Multithreaded code

*Enhanced connection from one .NET system to another .NET system

*Support for run time discovery and invocation of an objects method and properties

THE Common Language Runtime
The CLR is software Engine that load and manages the execution of code on the .NET plateform.
The architecture of .NET realized that all procedural language required certain base functionality. for example, Memory Management.
So, instead of each language shipping with its own runtime, it would be better if all language could use a common runtime.
The CLR consists of Various Components that provide the runtime environment and services for application.

*Class loader, load classes into the runtime.
*MSIL to Native code Complier, convert MSIL code into Native code.
*code manager, Manages code during execution.
*Garbage collector, performs automatic memory management
*Security engine, enforces strict type cheacking.
*Thread support, provide multithreading support to application.
*Exception manager, provides a mechanism to catch and handle run-time exceptions.
*Debug Engine, allows to debug applications.
*COM Marshaler, allows .NET application to exchange data with COM applications.
*Base Class Library support, provides the types that the applications need at runtime.

CLR Architecture

For an application to run with in the Common Language Runtime and benefits from the managed execution environment, need to write the source code of application in a CLS- compliant Language.
The compilers of CLS-Compliant languages compile the source code and generate an intermediate code, called MSIL code metadata.
The MSIL contain a CPU-independent set of instructions, which describes how to load, store, initialize and call methods on objects. To execute the code, the runtime requires information about the codethat is in the Metadata. The MSIL code and Metadata are located in a Portable Executable(PE) file.
After the MSIL code and the metadata are loaded into the memory, the code manages calls the Entery-point method, which is the WinMain, Main or DllMain method. An Entery point method is the first method to be executed when an application runs. The IL to Native code JIT compiler Compiles the entery point method before it is executed.
The CLR ships with two JIT compilers, the normal compiler and an economy compiler. The normal compiler examines a method's IL and optimizes the resulting code.
The economy JIT compiler is typically used on machines, where the cost of using memory and CPU cycles is high(wingows CE). The economy compiler compiles code much faster than the normal compiler, however the native code produced by the economy compiler is net optimized and is significantly less efficient.

No comments:

Post a Comment