Tuesday, 2 December 2014

Asp .net architecture

-:Asp .Net Architecture:


1)CLR(Common Language Runtime)

 
  




Introduction :
CLR: Common Language Runtime is the heart of .NET Framework used to manage the program written in .NET Framework compatible language (Eg. C#, Vb.NET, J# etc.). In other words, CLR is Execution Engine which executes the program for .NET Framework.
CLR: Common Language Runtime is the heart of .NET Framework used to manage the program written in .NET Framework compatible language (Eg. C#, Vb.NET, J# etc.). In other words,  CLR is Execution Engine which executes the program for .NET Framework.
Let's see some other definitions of CLR:
The common language runtime is the execution engine for .NET Framework applications.
It provides a number of services, including the following:
  • Code management (loading and execution)
  • Application memory isolation
  • Verification of type safety
  • Conversion of IL to native code
  • Access to metadata (enhanced type information)
  • Managing memory for managed objects
  • Enforcement of code access security
  • Exception handling, including cross-language exceptions
  • Interoperation between managed code, COM objects, and pre-existing DLLs (unmanaged code and data)
  • Automation of object layout
  • Support for developer services (profiling, debugging, and so on)
    (Source MSDN)
The Common Language Runtime (CLR) is the virtual machine component of Microsoft''s .NET initiative. It is Microsoft''s implementation of the Common Language Infrastructure (CLI) standard, which defines an execution environment for program code. The CLR runs a form of byte code called the Common Intermediate Language (CIL, previously known as MSIL (Microsoft Intermediate Language)
(source Wikipedia).


How CLR Works?

When we write a program in .NET compatible language, then the compiler for C#(csc) or VB.NET(vbc) compiles the code in IL (Intermediate Language) or MSIL(Microsoft Intermediate Language) and then IL will be the input of CLR's component Just In Time compiler to produce machine independent code.
Apart from the above CLR is also responsible for:
Memory management
Thread management
Exception handling
Garbage collection
Security


 



2)CLS(Common Language Specification)


CLS: It is a set of base rules, all .Net languages has to adopt to interoperate with each other. Most importantly after compilation any .Net language program has to generate the same type of output code known as Common Intermediate Language code as shown below.
                                  



3)CTS(Common Type System)


CTS: According to CTS(Common Type System), all .Net languages has to adopt uniform data structure i.e., similar types must be uniform in size in all languages of .Net. 

Most of the languages under .Net are derived from same existing language, so names of the data types will be differ from language to language. Even if the names are different  similar data types will always be same in size. 

A data type that is used in any language after compilation will be converted into IL type where in IL format all similar types will be same as following.
                            




4)FCL(Framework class Library)


The .Net Framework class library (FCL) provides the core functionality of .Net Framework architecture . The .Net Framework Class Library (FCL) includes a huge collection of reusable classes , interfaces, and value types that expedite and optimize the development process and provide access to system functionality.

The .Net Framework class library (FCL) organized in a hierarchical tree structure and it is divided into Namespaces. Namespaces is a logical grouping of types for the purpose of identification. Framework class library (FCL) provides the consistent base types that are used across all .NET enabled languages. The Classes are accessed by namespaces, which reside within Assemblies. The System Namespace is the root for types in the .NET Framework. The .Net Framework class library (FCL) classes are managed classes that provide access to System Services . The .Net Framework class library (FCL) classes are object oriented and easy to use in program developments. Moreover, third-party components can integrate with the classes in the .NET Framework.

No comments:

Post a Comment