Monday, August 25, 2008

C Sharp Basic Concept - framework tutorials

C# Language

C# does not allow multiple inheritances.
C# does not allow use of pointer.
Provide garbage memory collection at runtime.
C# comes with new and exciting features like reflection, marshalling, threads, remoting, attributes, streams and data Access with ADO.NET and more

The .NET Architecture and .NET Framework

The .Net Architecture and the .Net framework are different important terms and concept.

CLR (The Common Language Runtime)

The most important concept of the .Net Framework is the existence and functionality of Common Language Runtime (CLR).
It is also called .Net Runtime.
It is a framework layer that resides above the Operation system and handles all the execution of .Net application.

.Net programs are don’t diretly communicate with operating system bit go through the Common Language Runtime.

MSIL (Microsoft Intermediate Language)

When we compile our .net program using any .net compliant language such as C#, C++.NET VB.Net our source code does not get converted in to the executable binary code, but to an intermediate code known as MSIL which convert our program into executable binary code to CLR.

MSIL is operating system and hardware independent code.

Cross language relationships are possible as the MSIL code is similar for each .Net language.

Just in Time Complier (JIT)

When our MSIL compiled code needs to be executed, the CLR invokes the JIT compiler, which compile the IL code to native executable such as .exe or .dll that is designed for the specific machine and OS.

E.g. when a function is called, the IL of the functions body is converted to native code just in time. So, the part code is not used by that particular run is never converted to native code. if some IL code is converted to native code, then the next time it’s needed the CLR reuses the same copy without recompiling.

The Framework Class Library (FCL)

The .NET Framework provides a huge framework or Class library for common use (FCL). FCL contains thousands of classes to provide to Windows API and common functionalities like String Manipulation, Common Data Structure, IO, Streams, Threads, Security, and Web Programming etc.

The Common Language Specification (CLS)

CLS is simply called .Net compliant Language. All the .Net compliant language can make use of CLR and FCL. Microsoft has release a small set of specification that each language should meet a qualify as a .Net Compliant Language. As IL is a very rich language, its is not necessary for an language to implement all the IL functionality, rather, it merely needs to meet a small subset of CLS to qualify as a .Net Compliant language.

The Common Type Systems (CTS)

Like CLS, CTS is also a set of standards. CTS define the basics data types that IL understands. Each .Net compliant language should map its data types to these standard data types. For example CTS defines a type Int32, an integer data type of 32 bit94 byte) which is mapped by C# through int and VB.Net through Integer data types.

Garbage Collection (GC)

CLR also contains the garbage Collector (GC), which run in low-priority thread and checks for un-referenced dynamically allocated memory space.

The .Net Framework

The .Net framework is the combination of layers of CLR, FCL Data and XML Classes and our Windows, Web applications and Web services.

Download MS-Word file C# Basic Concepts

No comments: