Microsoft.NET

……………………………………………….Expertise in .NET Technologies

Overview of the Microsoft .NET

Posted by Ravi Varma Thumati on May 14, 2009

Introduction to Microsoft.NET

The Microsoft.NET platform provides all of the tools and technologies that you need to build distributed web applications. It exposes a language independent, consistent programming model across all tiers of an application.

Microsoft .NET framework has been designed with a goal of accomplishing many tasks in a simple, fast and efficient manner. There is quite a number of purpose-specific tools attached with this revolutionary framework. Also it can do things such as data access, windowing, connecting to the Internet, and much of the functionality of the Win32 API is now accessible through a very simple object model.

The .NET vision can be split into several different areas:

  • . NET Framework – the framework is an environment in which one can build, create, and deploy his applications and the next generation components, referred to as Web Services.
  • . NET Products – All of Microsoft’s products have been integrated into this grand vision and at its core, XML is the language to represent / describe the data, and SOAP is the primary protocol for data transmission
  • . NET Services – The services that can be developed and deployed in .NET platform.

In summary, the vision of .NET is globally distributed systems using XML as the universal glue to all functions running in different computing systems such as PCs, laptops, wireless /mobile devices, and other information and communication appliances to come together in a single application.

The .NET platform provides

  • A language-independent, consistent object oriented programming model across all tiers of an application
  • To provide a code execution environment that minimizes software deployment and versioning conflicts.
  • Seamless interoperability between technologies
  • Easy migration from existing technologies
  • Full support for the internet’s platform neutral, standards-based technologies, including Hypertext Transfer Protocol (HTTP), Extensible Markup Language (XML) and SOAP

Main Features of .NET

Now that we know some basics of .NET, let us see what makes .NET a wonderful platform for developing modern applications.

  • Rich Functionality out of the box

. NET framework provides a rich set of functionality out of the box. It contains hundreds of classes that provide variety of functionality ready to use in your applications. This means that as a developer you need not go into low level details of many operations such as file IO, network communication and so on.

  • Easy development of web applications

ASP.NET is a technology available on .NET platform for developing dynamic and data driven web applications. ASP.NET provides an event driven programming model (similar to Visual Basic 6 that simplify development of web pages (now called as web forms) with complex user interface. ASP.NET server controls provide advanced user interface elements (like calendar and grids) that save lot of coding from programmer’s side.

  • OOP’s Support

The advantages of Object Oriented programming are well known. .NET provides a fully object oriented environment. The philosophy of .NET is – “Object is mother of all.” Languages like Visual Basic.NET now support many of the OO features that were lacking traditionally. Even primitive types like integer and characters can be treated as objects – something not available even in OO languages like C++.

  • Multi-Language Support

Generally enterprises have varying skill sets. For example, a company might have people with skills in Visual Basic, C++, and Java etc. It is an experience that whenever a new language or environment is invented existing skills are outdated. This naturally increases cost of training and learning curve. . NET provides something attractive in this area. It supports multiple languages. This means that if you have skills in C++, you need not throw them but just mould them to suit .NET environment. Currently four languages are available right out of the box namely – VisualBasic.NET, C# (pronounced as C-sharp), Jscript.NET and Managed C++ (a dialect of Visual C++)). There are many vendors that are working on developing language compilers for other languages (20+ language compilers are already available). The beauty of multi language support lies in the fact that even though the syntax of each language is different, the basic capabilities of each language remain at par with one another.

  • Multi-Device Support

Modern lift style is increasingly embracing mobile and wireless devices such as PDAs, mobiles and handheld PCs. . . .NET provides promising platform for programming such devices. . NET Compact Framework and Mobile Internet Toolkit are step ahead in this direction.

  • Automatic memory management

While developing applications, developers had to develop an eye on system resources like memory. Memory leaks were major reason in failure of applications. . NET takes this worry away from developer by handling memory on its own. The garbage collector takes care of freeing unused objects at appropriate intervals.

  • Compatibility with COM and COM+

Before the introduction of .NET, COM was the de-facto standard for component zed software development. Companies have invested lot of money and efforts in developing COM components and controls. The good news is – you can still use COM components and ActiveX controls under .NET. This allows you to use your existing investment in .NET applications. . NET still relies on COM+ for features like transaction management and object pooling. In fact it provides enhanced declarative support for configuring COM+ application right from your source code. Your COM+ knowledge still remains as a valuable asset.

  • No more DLL Hell

If you have worked with COM components, you probably are aware of “DLL hell”. DLL conflicts are a common fact in COM world. The main reason behind this was the philosophy of COM – “one version of component across machine”. Also, COM components require registration in the system registry. .NET ends this DLL hell by allowing applications to use their own copy of dependent DLLs. Also, .NET components do not require any kind of registration in system registry.

  • Strong XML support

Now days it is hard to find a programmer who is unaware of XML. XML has gained such a strong industry support that almost all the vendors have released some kind of upgrades or patches to their existing software to make it “XML compatible”. Currently, .NET is the only platform that has built with XML right into the core framework. . NET tries to harness power of XML in every possible way. In addition to providing support for manipulating and transforming XML documents, .NET provides XML web services that are based on standards like HTTP, XML and SOAP.

  • Ease of deployment and configuration

Deploying windows applications especially that used COM components were always been a tedious task. Since .NET does not require any registration as such, much of the deployment is simplified. This makes XCOPY deployment viable. Configuration is another area where .NET – especially ASP.NET – shines over traditional languages. The configuration is done via special files having special XML vocabulary. Since, most of the configuration is done via configuration files, there is no need to sit in front of actual machine and configure the application manually. This is more important for web applications; simply FTPing new configuration file makes necessary changes.

  • Security

Windows platform was always criticized for poor security mechanisms. Microsoft has taken great efforts to make .NET platform safe and secure for enterprise applications. Features such as type safety, code access security and role-based authentication make overall application more robust and secure.

Principal Design Features

Interoperability:

Because interaction between new and older applications is commonly required, the .NET Framework provides means to access functionality that is implemented in programs that execute outside the .NET environment. Access to COM components is provided in the System.Runtime.InteropServices and System.EnterpriseServices namespaces of the framework and access to other functionality is provided using the P/Invoke feature.

Common Runtime Engine:

Programming languages on the .NET Framework compile into an intermediate language known as the Common Intermediate Language or CIL (formerly known as Microsoft Intermediate Language, or MSIL). In Microsoft’s implementation this intermediate language is not interpreted but rather compiled in a manner known as just-in-time compilation (JIT) into native code. The combination of these concepts is called the Common Language Infrastructure (CLI). Microsoft’s implementation of the CLI is known as the Common Language Runtime (CLR).

Language Independence:

The .NET Framework introduces a Common Type System, or CTS. The CTS specification defines all possible data types and programming constructs supported by the CLR and how they may or may not interact with each other. Because of this feature, the .NET Framework supports the exchange of instances of types between programs written in any of the .NET languages.

Base Class Library:

The Base Class Library (BCL), part of the Framework Class Library (FCL), is a library of functionality available to all languages using the .NET Framework. The BCL provides classes which encapsulate a number of common functions, including file reading and writing, graphic rendering, database interaction and XML document manipulation.

Simplified Deployment:

Installation of computer software must be carefully managed to ensure that it does not interfere with previously installed software, and that it conforms to increasingly tight security requirements. The .NET framework includes design features and tools that help address these requirements.

Security:

The design is meant to address some of the defects, such as buffer overflows, that have been exploited by malicious software. Additionally, .NET provides a common security model for all applications.

Portability:

The design of the .NET Framework allows for it to be platform agnostic, and thus be cross platform compatible. That is, a program written to use the framework should run without change on any type of system for which the framework is implemented. Microsoft’s commercial implementations of the framework cover Windows, Windows CE, and the Xbox 360. In addition, Microsoft submits the specifications for the Common Language Infrastructure (which includes the core class libraries, Common Type System, and the Common Intermediate Language), and the C# language, and the C++/CLI language to both ECMA and the ISO, making them available as open standards. This makes it possible for third parties to create compatible implementations of the framework and its languages on other platforms.

Visual Studio.NET

            Visual Studio.NET provides a development environment for building applications on the .NET framework. It provides some important enabling technologies to simplify the creation, deployment and ongoing evolution of secure, scalable, and highly available web applications and web services.

 Visual studio1

Features of Visual Studio.NET

 Visual Studio as a development tool provides the following:

  • Support for various development languages
  • Tools for building web applications, windows applications, and XML web services
  • Data access tools
  • Complete error handling including local debugging, remote debugging and tracing

 Following are some of the various applications that can be built using Visual Studio.

  • Console applications: These applications run from the command line and do not include a graphical interface, but are great for small tools or anything that will be run by another application.
  • Windows forms applications: These are Windows desktop applications written using the .NET framework; since they are .NET applications, they require that the .NET framework be on any computer that will run the application.
  • Windows services: Services are applications that run in the background while your computer is running. These are usually applications that will have to perform scheduled tasks or handle continuous network requests.
  • ASP.NET applications: ASP.NET is a powerful technology that is used to create dynamic web applications, often driven by a database. Many popular websites are written using ASP.NET, including those of e-commerce giants like Dell.
  • ASP.NET web services: ASP.NET provides a complete web services model that allows you to quickly and easily create web services.
  • Windows Mobile applications: Windows Mobile applications can run on devices that include the Compact framework; these include Pocket PC devices, as well as cell phones running the Microsoft Smartphone platform.
  • MFC/ATL/Win32 applications: You can also still create traditional MFC, ATL, or Win32 applications using C++. These applications do not need the .NET runtime to run, but also don’t include many of the benefits of working with the .NET framework.
  • Visual Studio add-ins: That’s right; you can use Visual Studio to write new functionality to be added into Visual Studio.
  • And more: Visual Studio also includes projects to deploy your application, work with databases, create reports, and more.

Visual Studio provides an extensible model for adding new projects to Visual Studio; many other Microsoft applications now integrate directly into the IDE. Some of the most common include SQL Server Reporting Services and Visual Studio Tools for Office.

Microsoft.NET Architecture

Visual studio2

 Overview of the Architecture

At the base is the Common Language Runtime (CLR), the engine that drives key functionality and .NET applications that have been compiled to a common language referred to as Microsoft Intermediate Language (MSIL) are executed. It includes a common system of data types. These common types plus a standard interface convention facilitate cross-language inheritance. CLR allocates and manages memory automatically and as well as does reference counting for objects and handles garbage collection.

CLR facilitates simpler, and faster software development as the system itself provides a suite of functionality. The most ambitious aspect of the CLR is that it is designed to support multiple programming languages and easily provides unprecedented levels of integration among those languages through a common typo system.

The middle layer includes the next generation of standard system services such as ADO.NET and security. These services are brought under the control of the framework, making them universally available and standardizing their usage across languages.

The top layer includes user and program interfaces such as Win Forms, Web Forms and Web Services that can be developed using ASP.NET, a section of .NET framework.

Overview of .NET Framework: 

The .NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services. The .NET Framework is designed to fulfill the following objectives:

The .NET framework is a collection of all the tools and utilities required to execute the .NET managed applications built in Visual Studio.NET. The .NET framework is based on a new common language runtime. It provides a common set of services for projects in .NET. Services provided by .NET framework are:

Microsoft distributes the .NET Framework in three forms:

  • The .NET Framework Redistributable package contains everything needed to run a program under the .NET Framework. It includes the Common Language Runtime, DLLs, and the ASP.NET extension for the IIS Web Server. This file can be downloaded from the Microsoft Web site and distributed with any application that needs it.
  • The .NET Framework SDK includes the Redistributable Package, and free “command line” compilers, development tools, and documentation. It can be downloaded from the Microsoft Web site and installed on any development machine.
  • Visual Studio.NET is a program product sold by Microsoft that wraps the compilers and tools in an IDE with project management, code generating wizards, editor, and debugger. This product is purchased from any software vendor, although many programmers will get their copy through a campus or corporate multi-user license or a MSDN subscription.

Service provided by .NET Framework

  • Secure, Multi-Language Development Platform:

Developers and IT professionals can count on .NET as a powerful and robust software development technology that provides the security advancements, management tools, and updates you need to build, test, and deploy highly reliable and secure software. .NET supports the programming language you prefer by providing one multi-language development platform, so you can choose how you want to work. The Common Language Runtime (CLR) provides support for powerful, static languages like Visual Basic© and Visual C#©, and the advent of the Dynamic Language Runtime (DLR) means that dynamic languages, such as Managed Jscript, IronRuby and IronPython, are also supported.

  • Rapid, Model-Driven Development Paradigm:

. NET offers pioneering solutions that enable rapid application development and result in dramatic increases in productivity. For example, the new ADO.NET Entity Framework offers a model-based development paradigm and a standards-based framework that raises the level of abstraction for database programming, allowing developers to cleanly separate one’s business logic, data and user interface. By programming against a conceptual application model instead of programming directly against a relational storage schema, developers can greatly reduce the amount of code and maintenance required for data-oriented applications.

  • Next-Generation User Experiences:

Windows Presentation Foundation (WPF) provides a unified framework for building applications and high-fidelity experiences in Windows Vista that blend together application UI, documents, and media content, while exploiting the full power of the computer. WPF offers developers support for both 2D and 3D graphics, hardware accelerated effects, scalability to different form factors, interactive data visualization, and superior content readability. Further, with a common file format (XAML), designers can become an integral part of the development process by working alongside developers in a workflow that promotes creativity while maintaining full fidelity.

  • Cutting-Edge Web Application Development:

ASP.NET is a free technology that enables Web developers to create anything from small, personal Web sites through to large, enterprise-class dynamic Web applications. Microsoft’s free AJAX (Asynchronous JavaScript and XML) framework – ASP.NET AJAX – enables developers to quickly create more efficient, more interactive, and highly personalized Web experiences that work across all of the most popular browsers. And the new ASP.NET Dynamic Data functionality in Visual Studio 2008 uses a rich scaffolding framework that allows rapid data-driven Web development without writing any code.

  • Secure, Reliable Web Services:

The service-oriented programming model of Windows Communication Foundation (WCF) is built on the Microsoft .NET Framework and simplifies development of connected systems and ensures interoperability. Windows Communication Foundation unifies a broad array of distributed systems capabilities in a composable and extensible architecture, spanning transports, security systems, messaging patterns, encodings, network topologies, and hosting models.

  • Enabling Mission-Critical Business Processes:

With .NET, developers can use Windows Workflow Foundation (WF) to model a business process with code, enabling closer collaboration between developers and business process owners, and providing end users with better access to data, thereby improving productivity.

  • Superior Reach Across Devices and Platforms:

The .NET Framework enables developers to build solutions for a wide array of devices, from personal computers and servers to mobile phones and embedded devices. Silverlight, a runtime that contains a subset of the .NET Framework, helps developers expand their reach by providing a cross-browser, cross-platform, and cross-device plug-in for delivering the next generation of .NET-based media experiences, advertising and rich interactive applications (RIAs).

Benefits of .NET Framework

  • Microsoft .NET Framework technology represents a very significant shift in technology paradigms, allowing developers to build componentized, reusable and highly scalable functionality that is available across a network or the Internet regardless of platform. If suppose every .NET solution becoming a set of building blocks, then software developers can easily reuse, rearrange, and integrate these blocks in a quick manner with each successive solution thereby reducing the time to take them to market or clients drastically.
  • If we take .NET to the next level, it becomes even easier to develop integrated solutions with partners, customers, users and suppliers outside our enterprise. The very nature of the code and platform make it simpler and less costly.
  • Most new technologies go through an adoption curve that gives the opportunity to prepare slowly for their implementation. Microsoft .NET offers a complete, well-thought-out, stable, and robust platform that’s ready for prime time. It shortens the development time, enables us to have bug-free, flexible and elegant software solutions
  • The change .NET brings for developers are quite dramatic, and so is the learning curve for those developers who typically use Visual Basic COM applications. . NET languages such as C# and VisualBasic.NET will give the software developers enough opportunity to take forward their ambitions.
  • We spend very less design, development, and deployment time for .NET projects. This is because .NET includes a vast class of libraries and an Integrated Development Environment (IDE) that allows developers to build business logic and Web-based user interfaces significantly faster than ever before.
  • The real value of the .NET platform lies not in delivering pigeonholed projects better, faster, and cheaper (although it can do that quite well) but in building solutions that can be easily leveraged throughout the enterprise and beyond.

Features of .NET Framework

  • The VB language has been hugely upgraded, so it now includes classes and most of the features previously accessible in C++.
  • A new language, C#, has been introduced, which combines the efficiency of C++ with some of the ease of development of VB.
  • Memory management for .NET applications is much more sophisticated, meaning that a badly behaved .NET component is extremely unlikely to crash other components running in the same process.
  • ASP.NET, the replacement for ASP, offers compiled web pages (making processing of web requests much more efficient) and includes a large number of pre-written components that can generate commonly used HTML form and user-interface items
  • The main programming languages have been moved far closer together, so code written in VB, C++ and C# can be intermixed
  • Components are wrapped up in a new unit called an assembly, which is highly self-describing, making installation and use of components very easy.

Core components of .NET

  • NET Framework
    • CLR (Common Language Runtime)
    • CTS (Common Type System)
    • CLS (Common Language Specifications)
  • Base Class Library
  • ADO.NET: Data and XML
  • User Interface

Architecture of .NET Framework 

The core aspects of the .NET framework lie within the Common Language Infrastructure (CLI). The purpose of the CLI is to provide a language-agnostic platform for application development and execution, including functions for exception handling, garbage collection, security, and interoperability. Microsoft’s implementation of the CLI is called the Common Language Runtime (CLR).

Visual studio3

Visual studio4

Common Language Runtime (CLR)

            The .NET Framework provides a run-time environment called the common language runtime, which runs the code and provides services that make the development process easier.

The Common Language Runtime (CLR) is the heart of the .NET Framework and provides a runtime environment for .NET applications. The CLR is similar in function to the Java Virtual Machine (JVM) in the WebSphere environment and provides a fundamental set of services that all programs can use. The Java byte code can be interpreted as well as compiled, and it is the only language that the JVM runs. The Common Language Runtime has ability to compile managed code once and run on any CPU and operating system that supports the runtime. The CLR runs Intermediate Language, which is created from any .NET programming language, such as VB.NET and C#. The figure below shows the role of the Common Language Runtime while executing the managed code.

 Visual studio5

Fig: Common Language Runtime in .NET Framework

In the .NET Framework, managed code is the code, which follows the Common Language Specification (CLS). The managed code gets compiled into the Microsoft Intermediate Language (MSIL). The Common Language Runtime provides a just-in-time compiler that compiles the MSIL into the machine language and then runs it, because all programs use the common services in the CLR, no matter which language they were written in. The Common Language Runtime follows the Common Type System (CTS), which is a master set of data types. Due to the Common Type System, managed code written in various languages can interoperate with programs written in another CLR language.

Some of the features of Common Language Runtime are:

  • Garbage collection
  • Cross language integration
  • Base Class Library Support
  • Thread Support
  • Exception Manager
  • Security
  • IL to Native
  • Class Loader

The common language runtime features are described in below diagram.

 Visual studio6

Component

Description

Class Loader Manage metadata, in addition to the loading and layout of classes.
Microsoft intermediate language (MSIL) to native compiler Converts MSIL to native code (Just-in-time)
Code Manager Manage code execution
Garbage Collector Provides automatic lifetime of all of your objects. This is a multiprocessor, scalable garbage collector.
Security Engine Provides evidence based security, based on the origin of the code in addition to the user.
Debug Engine Allows you to debug your application and trace execution of code.
Type Checker Will not allow unsafe casts or un-initialized variables. MSIL can be verified to guarantee type safety.
Exception Manager Provides structured exception handling which is integrated with windows structured exception handling. Error reporting has been improved.
Thread Support Provides classes and interfaces that enable multi-threaded programming.
COM Marshaler Provides marshaling to and from COM.
Base Class Library (BCL) Support Integrates code with the runtime that supports the BCL.

The Common Language Specification (CLS)

The Common Language Specification (CLS) defines the common standards to which languages and developers must adhere if they want their components and applications to be widely useable by other. NET-compatible languages

Common Type System (CTS)

The Common Type System defines how data types are declared, used, and managed in the runtime, and is also an important part of the runtime’s support for the Cross-Language Integration. The common type system performs the following functions:

  • Establishes a framework that enables cross-language integration, type safety, and high performance code execution.
  • Provides an object-oriented model that supports the complete implementation of many programming languages.
  • Defines rules that languages must follow, which helps ensure that objects written in different languages can interact with each other.

The Common Type System can be divided into two general categories of types, Reference type and Value type each of which is further divided into subcategories.

Visual studio7

 Fig: Common Type System Architecture

The .NET type system has two different kinds of types namely Value types and Reference types. Value types directly contain the 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. The core value types supported by the .NET platform reside within the root of the System namespace. There types are often referred to as the .NET “Primitive Types”.

They include:

  • Boolean
  • Byte
  • Char
  • DateTime
  • Decimal
  • Double
  • Guid
  • Int16
  • Int32
  • Int64
  • SByte
  • Single
  • Timespan

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 .NET Framework Class Library

            The .NET framework class library exposes features of the runtime and provides other high level services that every developer needs through an object hierarchy. This object hierarchy is called Namespace.

 Visual studio8

ADO.NET: Data and XML

ADO.NET is the next generation of Microsoft ActiveX Data Object (ADO) technology. ADO.NET is heavily dependent on XML for representation of data. It also provides an improved support for the disconnected programming model.

ADO. Net’s DataSet object, is the core component of the disconnected architecture of ADO.NET. The DataSet can also be populated with data from an XML source, whether it is a file or an XML stream.

User Interface

The next layer consists of the user and programming interface that allows .NET to interact with the outside world. The following are the types of interaction interfaces that are supported by the .NET framework:

  • Web Forms
  • Windows Forms
  • Web Services

2 Responses to “Overview of the Microsoft .NET”

  1. Many thanks for posting this, It?s just what I was researching for on bing. I?d so much relatively hear opinions from a person, slightly than an organization web web page, that?s why I like blogs so significantly. Many thanks!

  2. My neighbor and I have been just debating this particular topic, he is normally looking for to show me incorrect. Your view on this is great and precisely how I actually feel. I just now mailed him this web site to show him your personal view. After wanting over your website I ebook marked and can be coming again to learn your new posts!

Leave a comment