Saturday, August 4, 2018

Architecture of .Net Framework

Architecture of .Net Framework


The architecture of .NET framework is tiered, modular, and hierarchical architecture. Each tier of the .NET Framework is a layer of abstraction. .NET languages are the top tier and the most abstracted level. The common language runtime is the bottom tier, the least abstracted, and closest to the native environment. This is important since the common language runtime works closely with the operating environment to manage .NET applications. The .NET Framework is partitioned into modules, each with its own distinct responsibility. Finally, since higher tiers request services only from the lower tiers.

The .NET Framework is a managed environment. The common language runtime monitors the execution of .NET applications and provides essential services. It manages memory, handles exceptions, ensures that applications are well-behaved, and much more.

         Language interoperability is one goal of .NET. The .NET languages share a common runtime (the common language runtime), the Framework Class Library (FCL), a common component model, and common types. In .NET, the programming language is a lifestyle choice. Except for subtle differences, C#, VB.NET, or JScript. .NET offer a similar experience.


Components of .Net Framework:-

  Common Language Runtime (CLR)
  .Net Framework Class Library
  Common Type System (CTS)
  Common Language Specification (CLS)

Common Language Runtime (CLR):

Common Language Runtime (CLR) is the programming environment (Virtual Machine component) that manages the execution of programs written in any language. The common language runtime (CLR) is the core runtime engine for executing applications in the .NET Framework. The CLR allows an instance of a class written in one language to call a method of the class written in another language. The Common Language Runtime (CLR) is a very important part of the .NET Framework. At the base level, it is the infrastructure that executes applications, and allows them to interact with the other parts of the Framework. The .Net Framework provides runtime environment called Common Language Runtime (CLR). .It provides an environment to run all the .Net Programs. The code which runs under the CLR is called as Managed Code. Programmers need not to worry on managing the memory if the programs are running under the CLR as it provides memory management and thread management. The main function of Common Language Runtime (CLR) is to convert the Managed Code into native code and then execute the Program. It acts as a layer between Operating Systems and the applications written in .Net languages.
CLR handles the execution of code and provides useful services for the implementation of the program. In addition to executing code, CLR provides services such as memory management, thread management, security management, code verification, compilation, and other system services.
Functions of CLR:
             ·         Conversion of IL to native code
             ·         Exception handling
             ·         Type safety
             ·         Memory management (using the Garbage Collector)
             ·         Security
             ·         Improved performance
             ·         Language independency
             ·         Platform independency
             ·        Architecture independency

Framework Class Library (FCL):

The .NET Framework Class Library (FCL) is a set of managed classes that provide access to system services. File input/output, sockets, database access, remoting, and XML are just some of the services available in the FCL. Importantly, all the .NET languages rely on the same managed classes for the same services. This is one of the reasons that, once you have learned any .NET language, you have learned 40 percent of every other managed language. The same classes, methods, parameters, and types are used for system services regardless of the language. This is one of the most important contributions of FCL.
Common Type System (CTS):
CTS define some basic data types that IL can understand. The common type system defines how types are declared, used, and managed in the common language runtime. It important part of the runtime's support for cross-language integration, type safety, and high-performance code execution. It provides an object-oriented model that supports the complete implementation of many programming languages. It defines rules that languages must follow, which helps ensure that objects written in different languages can interact with each other. Provides a library that contains the primitive data types (such as Boolean, Byte, Char, Int32, and UInt64) used in application development.
Common Language Specification (CLS):
It is a sub set of CTS and it specifies a set of rules that needs to be adhered or satisfied by all language compilers targeting CLR. It helps in cross language inheritance and cross language debugging. Common Language Specification (CLS) is a set of basic language features that .Net Languages needed to develop Applications and Services , which are compatible with the .Net Framework. Microsoft has defined some specifications that each .Net language has to follow. When there is a situation to communicate Objects written in different .Net Complaint language, those objects must expose the features that are common to all the languages. Common Language Specification (CLS) ensures complete interoperability among applications, regardless of the language used to create the application.

- Prof. Shardul P. Patil

No comments:

Post a Comment