Friday 5 February 2016

Some Features of .NET and Common Language Runtime (CLR)

What Is .NET & CLR?

.NET is a platform for distributed Web/Desktop/Database applications. Distributed applications are composed of disparate resources in multiple locations—the database might be in India, the inventory control software in Singapore, and the data entry software in Bangladesh. It offers a new model for sharing components. The Common Language Runtime is at the heart of the .NET framework and consists of infrastructure and services to enable global-scale hosting.

Common Language Runtime(CLR) diagram
.NET offers a multi-language platform that gives the freedom to choose a language. All features of a .NET platform are available to any .NET programming language, and application components can be written in multiple languages. It has highly leveraged tools. Debuggers, profilers, code coverage analyzers, and so on work for all languages.
It simplifies deployment and management. Applications are grouped into assemblies, which are the units of deployment, versioning, and security. Assemblies are like DLLs, but self-describing through a manifest. .NET has a system of zero-impact install. Applications and Language components can be shared or private, and applications enjoy side-by-side execution. Multiple versions of the same component can co-exist, even in the same process.

Common Language Runtime (CLR) features

The Common Language Language Runtime is robust and secure because it includes the following features:
  • Automatic lifetime management
  • Garbage collection for all .NET objects, Multi-generational mark-and-compact garbage collection (GC)
  • No stray pointers, no circular references
  • Self-configuration, dynamic tuning
  • Exception handling, Error handling as a first-class concept (not Boolean or HRESULTs), Dramatically improved error reporting
  • Windows Language SEH integration
  • Several compilation models: Native (for example, Managed C++) and Microsoft Intermediate Language (MSIL or IL) (for example, VB and C#)
  • Lack of an interpreter as the code compiles at install-time or runtime
  • Code correctness and type safety, Verifiable IL that guarantees type safety
  • No unsafe casts, no uninitialized variables, no out-of-bounds array indexing
  • Evidence-based security, Both code- and user-based security
  • Extensible permissions

Simplicity to Develop in .NET

The simplicity that .NET provides is based on some careful design, including the following features:
  • Code is organized in hierarchical namespaces and classes.
  • A unified type system is in use.
  • Everything is an object—no variants, one string type—and all character data is Unicode.
  • All development is component oriented.
  • Properties, methods, events, and attributes are first class constructs.
  • Developing with .NET provides design-time functionality.
  • The entire system is factored and extensible.
  • Any .NET class is available for you to extend through inheritance.
  • Unlike COM, you’re using and extending the class itself, not a “wrapper.”
  • Plug-and-play components and subsystems are constructed into the infrastructure.
  • There is pervasive cross-language inheritance.

1 comment: