Friday, 5 December 2014

.Net Framework Architecture: - Introduction


.Net Framework Architecture: - Introduction
The .Net Framework work as an interface between the .Net Application and the operating system.

The .NET Framework consist of following two components
1.       Common Language Runtime
2.       Framework Class Library


  
Common Language Runtime: - Introduction

The CLR defines the Common Type System (CTS), which is a standard type system used by all .Net languages. That means all .NET programming languages uses the same representation for common Data Types, so Common Language Runtime (CLR) is a language-independent runtime environment. The Common Language Runtime (CLR) environment is also referred to as a managed environment, because during the execution of a program it also controls the interaction with the Operating System. 


Component of CLR: - Introduction
The Common Language Runtime (CLR) is an Execution Environment. It works as a layer between Operating Systems and the applications written in .Net. The main function of Common Language Runtime (CLR) is to convert the Managed Code into native code and then execute the Program.

The CLR has the following components
1.       Common Type System
2.       Common Language Specification
3.       Microsoft Intermediate Language
4.       Garbage Collector
5.       Code Manager
6.       JIT Compiler - Introduction


Common Type System: - Introduction
A fundamental part of the .NET Framework's Common Language Runtime is the CTS. The CTS defines a common set of types that can be used with many different languages.

Common Type System (CTS) describes a set of types that can be used in different .Net languages in common .The Common Type System (CTS) ensure that objects written in different .Net languages can interact with each other .

The Common Type System (CTS) is a standard for defining and using data types in the .NET framework. CTS define a collection of data types, which are used and managed by the run time to facilitate cross-language integration.

CTS provide the types in the .NET Framework with which .NET applications, components and controls are built in different programming languages so information is shared easily. In contrast to low-level languages like C and C++ where classes/structs have to be used for defining types often used (like date or time), CTS provides a rich hierarchy of such types without the need for any inclusion of header files or libraries in the code.

The common type system supports two general categories of types, each of which is further divided into subcategories:
1.    Value types: - Value types directly contain their data, and instances of value types are either allocated on the stack or allocated inline in a structure. Value types can be built-in (implemented by the runtime), user-defined, or enumerations.

2.   Reference types:-Reference types store a reference to the value's memory address, and are allocated on the heap. Reference types can be self-describing types, pointer types, or interface types. The type of a reference type can be determined from values of self-describing types. Self-describing types are further split into arrays and class types. The class types are user-defined classes, boxed value types, and delegates.

Microsoft Intermediate Language: - Introduction
MSIL stands for Microsoft Intermediate Language. We can call it as Intermediate Language (IL) or Common Intermediate Language (CIL).The VC# compiler translates or builds the source code into Microsoft Intermediate Language (MSIL). This language is stored into a special file. This file is called Assembly. An assembly is simply an executable file that has an .exe or .dll extension.
During the compile time, the compiler convert the source code into Microsoft Intermediate Language (MSIL) .Microsoft Intermediate Language (MSIL) is a CPU-independent set of instructions that can be efficiently converted to the native code.

During the runtime the Common Language Runtime (CLR)'s Just In Time (JIT) compiler converts the Microsoft Intermediate Language (MSIL) code into native code to the Operating System.

When a compiler produces Microsoft Intermediate Language (MSIL), it also produces Metadata. The Microsoft Intermediate Language (MSIL) and Metadata are contained in a portable executable (PE) file.

Microsoft Intermediate Language (MSIL) includes instructions for loading, storing, initializing, and calling methods on objects, as well as instructions for arithmetic and logical operations, control flow, direct memory access, exception handling, and other operations

Garbage Collector
The process of removing the objects from the memory which are no longer required is called as Garbage Collection. The .NET garbage collector enables high-speed allocation and release of memory for the objects in managed code. Its main aim is proper memory management.

Code Manager
Code manager invokes class loader for execution. .NET supports two kind of coding 
1.       Managed Code
2.       Unmanaged Code

The code, which is developed in .NET framework, is known as managed code. This code is directly executed by CLR with help of managed code execution. Any language that is written in .NET Framework is managed code.

The code, which is developed outside .NET, Framework is known as unmanaged code. Applications that do not run under the control of the CLR are said to be unmanaged, and certain languages such as C++ can be used to write such applications, which, for example, access low - level functions of the operating system

Unmanaged code is executed with help of wrapper classes. Wrapper classes are of two types: CCW (COM Callable wrapper) and RCW (Runtime Callable Wrapper).

JIT Compiler - Introduction
The JIT stands for Just In Compiler. When we run the .Net application the Just In Time (JIT) compiler converts the Microsoft Intermediate Language (MSIL) code into native code to the Operating System.
When we compile a Microsoft.NET language, the complier generates code written in the Microsoft Intermediate Language (MSIL). MSIL is a set of instructions that can quickly be translated into native code.
A Microsoft.NET application can be run only after the MSIL code is translated into native machine code. In .NET Framework, the intermediate language is complied "just in time" (JIT) into native code when the application or component is run.

The Microsoft.NET runtime consists of two JIT compilers. They are standard JIT compiler and the EconoJIT compiler. The EconoJIT compiler compiles faster than the standard JIT compiler, but the code it produces is not as optimized as the code obtained from the standard JIT compiler.

Thursday, 4 December 2014

Genesis of .Net Framework



Genesis of .Net:- Introduction
The following are the .Net generations:-

1.       Microsoft started development of the .NET Framework in the late 1990.At the end of 2000 the first beta versions of .NET 1.0 were released.

2.       The first version of .Net was the .Net 1.0. It is released in Feb 2002. It is not distributed with any operating system. The development tool with this version was visual Studio .Net.

3.       The second version of .Net Framework was .Net 1.1.This version is released in April 2003 with Windows server 2003. The development tool with this version was visual Studio .Net 2003.

4.       The third version of .Net Framework was .Net 2.0.This version is released in November 2005 with Windows server 2003 R2. The development tool with this version was visual Studio .Net2005.

5.       The fourth version of .Net Framework was .Net 3.0.This version is released in November 2006 with Windows Vista and Windows server 2008. The development tool with this version was Expression Blend.

6.       The Fifth version of .Net Framework was .Net 3.5.This version is released in November 2007 with Windows 7 and Windows server 2008 R2. The development tool with this version was Visual Studio 2008.

7.       The Sixth version of .Net Framework was .Net 4.0.This version is released in April 2010.It is not distributed with any operating System. The development tool with this version was Visual Studio 2010.

8.       The seventh version of .Net Framework was .Net 4.5.This version is released in August 2012 with Windows 8 and Windows server 2012. The development tool with this version was Visual Studio 2012.

9.       The .NET Framework family also includes two versions for mobile or embedded device use. A reduced version of the framework, the .NET Compact Framework, is available on Windows CE platforms, including Windows Mobile devices such as smart phones.

Introduction of .NET Framework, Objective of Framework



.NET Framework: - Introduction
1.       The .NET Framework is a software framework developed by Microsoft that runs on Microsoft Windows operating system.

2.       The .NET Framework is a development and execution environment that allows different programming languages & libraries to work together.

3.       W can create Windows-based applications as well as web based application using the .net framework. These applications are easier to build, manage, deploy, and integrate with other networked systems.

4.       The .NET Framework is language neutral. Currently it supports C++, C#, Visual Basic, JScript (The Microsoft version of JavaScript) ,COBOL and other languages. Third-party languages - like Eiffel, Perl, Python, Smalltalk, and others - will also be available for building future .NET Framework applications.

5.       The.NET Framework provides a new programming model and rich set of classes designed to simplify application development for Windows, the Web, and smart devices.

6.       The .NET Framework contains common class libraries - like ADO.NET, ASP.NET and Windows Forms - to provide advanced standard services that can be integrated into a variety of computer systems.

Objective of .NET
The .NET Framework is designed to fulfill the following objectives:
1.       A consistent object-oriented programming environment, where object code can be stored and executed locally, executed locally but Internet-distributed, or executed remotely.

2.       A code-execution environment that minimizes software deployment and versioning conflicts.

3.       A code-execution environment that guarantees safe execution of code, including code created by an unknown or semi-trusted third party.

4.       A code-execution environment that eliminates the performance problems of scripted or interpreted environments.

5.       Developers can experience consistency across widely varying types of applications, such as Windows-based applications and Web-based applications.

6.       Build all communication on industry standards to ensure that code based on the .NET Framework can integrate with any other code.