.NET Introduction

.NET Introduction and brief history.

Micorosft released the .NET framework in the year 2002. This new framework was carefully designed to address old problems and provide a modern environment for creation of applications for many years to come.

The .NET Framework provides Object Orientation features and consistency as compared to older technologies like MFC and COM.

Features/Advantages of Microsoft.NET

Here are some of the eye catching features of .NET Framework.

No. Feature/Advantage Description
1. Cross Platform .NET can run on a wide variety of devices and platforms from desktops/laptops to servers to cell phone.This makes it a modern general purpose platform that can be used to build anything.
2. Security .NET was designed with security in mind. This was important as it designed after the inception of internet where security was seen as big problem. With .NET even code obtained from a suspect source is executed in a secure environment.
3. Modern Communication Standards .NET is a mature framework that incorporates the best industry communication standards such as HTTP, JSON, SOAP, XML and WSDL.
4. Interoperable Code written with .NET are not only interoperable among various .NET languages but also with the existing code written in COM as well as Win32 DLLs.
5. Numerous Programming Languages .NET Platform allows developers make applications using numerous programming languages like C#,VB, F# etc.
6. Common runtime All .NET languages share a common runtime which common predifined types.
7. Simplifified Deployment Model .NET programs, as compared to the previous windows technologies, are much easier to deploy. This because of the following reasons:
  1. .NET programs do not need registration at the registry.
  2. Through side by side execution, different versions of DLLs can exist on the same machine. Hence every executable can have access to the version of the DLL it was built for.

    | 8. | Type Safety | The CLR in the .NET Framework ensures that data objects as well method parameters and return types are type safe. |

Before .NET Framework

C# is a programming language created to run on .NET Framework.

However, C# as well as .NET Framework are relatively new, only introduced in the year 2002.

However, even before them windows programming had existed and applications were being created.

In the 1990s, making windows applications basically involved three technologies:

No. Technology Description
1. Win32 API Using raw C and C++ code to interact with Operating System APIs.
2. MFC Microsoft Foundation Classes. Most popular at the time.
3. COM Component Object Model.

Disadvantages of the Previous Pre .NET Techniques

The above techniques for creating Windows applications had the following disadvantages.

No. Technology Disadvantage
1. Win32 API Using raw Win32 API was complex and error prone. It wasn't Object Oriented therefore programs could become overly complex to manage.
2. MFC MFC was getting old and inconsistent and needed replacing even though it was Object Oriented.
3. COM With COM a programmer could build libraries that were sharable and usable by a variety of programming language. Certainly this language-independence was useful. However, working with COM was complex and had fragile deployment model. Deployment was only conceivable in Windows. However, with .NET platform we get a more powerful, flexible and simpler programming model.

Clearly the successor to the above technologies had to take not only the above issues in mind but also the fact that we had just entered and internet age.

Internet required strong security and cross platform capability among applications. Performance also had to catered for.

Not only was there a need for better execution environment with respect to security, performance and cross platform capability, but also the development environment had to modernised.

Object Oriented Programming methodology was getting more and more popular and it was clear it was the future.

With the internet age, creation distributed applications needed industry standards communication protocols to be intergrated into programming languages.

The inception of internet also added yet another type of application development: those that run on the server. Microsoft therefore needed the provision of a consistent programming experience.

.NET Assemblies

.NET binaries takes the same file extensions as unmananged windows binaries.These binaries in the form of .dll or .exe. This applies to all .NET languages. Normally .NET binaries do not have platform-specific code, ratjer it contains platform-agnostic code. This code is called Intermediate Language(IL) code.

IL code can also be called MSIL(Microsoft Intermediate Language) or CIL(Common Intermediate Language). All these describe the same instructon set. The resulting blob from the compilation of .NET program is what is called an assembly. This blob is in the form of :

  • .dll or
  • .exe

Assemblies comprise CIL code. CIL code are not compiled to platform specific instructions until necessary. This is until the point when a block of CIL instructions is referenced for use by the .NET runtime.
If you come from Java world then this is the same as Java Bytecode atleast conceptually.

However, assemblies don't just contain instructions. They also contain metadata.

Roles of the Metadata.

The metadata :

  • Describes the characteristics of the types existing within that binary. These characteristics of types comprise:
    • Base Class of a type.
    • Interfaces imlemented.
    • Members supported by a type.
  • Describes the assemblies. This metadata that describes assemblies is termed as the manifest.The manifest contains:
    • Currents Assembly version.
    • Culture Information
    • Externally Referenced assemblies.

Common Intermediate Language

Common Intermediate Language is abbreviated as CIL.

This is an Intermediate Language onto which code found in an assembly exists.

CIL sometimes is also called IL(Intermediate Language) or MSIL(Microsoft Intermediate Language).

CIL Sits above .NET language.

Compilation of a typical C# class results into a .exe assembly file containing:

  1. Manifest.
  2. CIL instructions
  3. Metadata describing the type.

.NET aware languages do emit CIL code and not platform specific instructions.

Benefits of CIL

1. Language Integration.

This is possible since the CIL instructions that are generated are almost identical.
Thus the languages can interact within a low-level arena.

2. Platform-Agnostic.

CIL contains platform agnostic code hence this makes .NET Framework itself platform agnostic.

.NET Base Class Library

The Base Class Library(BCL) is an extensive set of available code provided by the .NET framework.

Here are some of the categories of the base class library:

No. Category Description
1. General Classes These are base classes for performing common programming tasks like manipulating strings,files etc.
2. Collection Classes Classes for working with collections like lists, dictionaries and hash tables.
3. XML Classes Classes for creating and manipulating XML documents.
4. Threading Classes

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *