Вы находитесь на странице: 1из 17

Microsofts .

NET Technology

Contents
Page no 1. Abstract. 2. Introduction. 3. The .NET Framework 4. Why .NET Makes Sense? 5. Criticism to .NET 6. Alternative implementations 7. Conclusion 8. Future of .NET 9. References 2 3 5 9 13 14 15 16 17

Department of MCA, NMAM -IT, Nitte

Microsofts .NET Technology

1. Abstract
The .NET Framework is such a comprehensive platform that it can be a little difficult to describe. I has been described as a Development Platform, an Execution Environment, and an Operating System among other things. In fact, in some ways each of these descriptions is accurate, if not sufficiently precise. The software industry has become much more complex since the introduction of the Internet. Users have become both more sophisticated and less sophisticated at the same time. Folks who had never touched a computer less than five years ago are now comfortably including the Internet in their daily lives. Meanwhile, the technophile or professional computer user has become much more advanced, as have their expectations from software. It is this collective expectation from software that drives our industry. Each time a software developer creates a successful new idea, they raise user expectations for the next new feature. In a way this has been true for years. But now software developers face the added challenge of addressing the Internet and Internet-users in many applications that in the past were largely unconnected. It is this new challenge that the .NET Framework directly addresses.

Department of MCA, NMAM -IT, Nitte

Microsofts .NET Technology

2. Introduction
Seeing brings about evolution. Vision brings about revolution. .NET is Microsoft's vision of how computing is going to take place in future. A small peek at .NET can help anybody realize that this time around Microsoft has brought about a revolution. For real! If you take a peep into the future you would see .NET written all over it. .NET offers a whole new paradigm that will change the way you think about writing software. This chapter would help us to understand the .NET vision. Though it might be difficult to imagine today, the world was still in the mainframe era two decades ago. Few people had access to or used computers. Home computing was unheard of and computers were used only through an IT department at work. The three most influential factors that were responsible for changing this scenario are the PC, the Graphical User Interface and the World Wide Web. With their arrival millions of more users started using computers. The ability of handling graphics, audio and video with ease was sufficiently exciting for an average user to get drawn towards computing. They were responsible for democratizing computing for hundreds of millions of people and for transforming computer into a mass-market product. Computing has now become a key activity in the daily lives of business employees and home users. What will the next generation of computing look like? It would be an online world where millions of PCs, servers, PDAs (Personal Data Assistants), email devices, mobile phones, digital diaries, digital copiers, etc, would collaborate with each other through internet based services. It would make available the information that you and your business needs irrespective of the place where you are and the computing device, platform or the application that you are using. This vision however is yet to be achieved. Let us now see what are the major hurdles that current computing world needs to cross to achieve this vision.

Server-Centric Model:
Today's Internet is still the reflection of mainframe era's server-centric model. Most of the information your business needs is locked up in centralized databases and served to you a page at a time. The browser largely plays the role of the dumb terminal. Web pages provide a "picture" of data, not the data itself. Integrating this data with your business's existing systems and that of your partners is not only costly but often frustrating.

Poor Integration:
Though today's standalone applications and web sites provide good functionality and data most of the time they still work in isolation. One has to navigate manually between websites, devices and applications, rarely being able to integrate the functionality and data. An apparently simple task of arranging a meeting with colleagues and automatically updating every attendee's calendar still remains a complicated computing job. As a result, productivity suffers.

Department of MCA, NMAM -IT, Nitte

Microsofts .NET Technology

Web-Centric View:
As the software engineering matured the demand on productivity, scalability and robustness increased. This led to developing software in the form of reusable components. With the widespread availability of network the concept of componentization was extended to Distributed Computing. The DCOM (Distributed Component Object Model) from Microsoft, CORBA (Common Object Request Broker Architecture) from Object Management Group and the RMI (Remote Method Invocation) from Sun became popular models for developing software in the form of components that would work in the distributed environment. To help build these reusable components two frameworks came into existencethe DNA (Distributed Network Architecture) framework and the J2EE (Java Enterprise Edition) from the Java camp. However, both these frameworks were built around the platform that is connected to the Internet. This promotes a device-centric view of the world. What is needed today is to change the framework from device centric to Internet/Intranet/Web-centric. Under this framework software will be available as a set of distributed services with the devices (PC, PDA, Mobile, etc.) acting as mere points of delivery of services. These services are known as Web Services. Like components they are programmable and reusable. They are available anywhere via the Internet. Programs built using this model will run across multiple websites extracting information from each of them and combining and delivering it in a customized form to any device anywhere in the world. To meet the challenge of next generation of internet-based computing Microsoft has come up with the .NET platform. This platform simplifies the process of building these solutions and provides a framework for integration and interoperability. This platform is based on open standards like (XML and SOAP) so that it can work across all programming languages and operating systems. It helps you to combine the power of PCs and smart devices with the richness of Internet.

Department of MCA, NMAM -IT, Nitte

Microsofts .NET Technology

3. The .NET Framework


The .NET framework is a high productivity, standards-based, multi-language application execution environment that handles essential plumbing chores and eases deployment. It provides an application execution environment that manages memory, addresses versioning issues and improves the reliability, scalability, and security of your application. .NET is actually a wrapper around the operating system. Software developed with .NET doesnt have to worry about operating system tasks like File Handling and Memory Allocation. Even though Microsoft doesnt say so, this appears to be a silent preparation for the future where the software developed for .NET would be portable to a wide variety of Hardware and OS..NET makes development of Internet applications as easy as Desktop applications. It also provides a very high level of integration of front, middle and back-tier. The .NET framework consists of several parts, including the Common Language Runtime and a rich set of class libraries. The Figure 3.1 shows major components of .NET framework.

User and Language Interfaces

.NET Base Classes

Common Language Runtime

Figure 3.1

The Common Language Runtime:


A runtime is an environment in which programs are executed. For example, to execute a program written in VB6, the machine must have a VB runtime (msvbvm.dll) installed. Similarly VC++ programs and Java programs too require unique runtime components. Since different languages require different runtime the developers life becomes more difficult. Imagine a situation where an ActiveX control has been developed in VB. While downloading this component a user may also have to download the VB runtime if it is not already installed on the machine. And imagine what would be the solution if Windows werent installed on the machine. To avoid such problems .NET introduces a single Common Language Runtime (CLR) that all .NET languages share. The Figure 3.1 shows how CLR works.

Department of MCA, NMAM -IT, Nitte

Microsofts .NET Technology

VB Source Code VC++ Source Code

Compiler

IL Linker

Compiler

IL EXE or DLL

Class Library Gets executed under CLR

JIT Compiler

Native Code

Figure 3.2

Once our code is written, we compile it, and the compiler translates it to Microsoft Intermediate Language (MSIL). MSIL is a CPU-independent set of instructions that can be efficiently converted to native (CPU dependent) code. MSIL code is a language independent code. The Linker then links the IL code converted by one language compiler with the IL code compiled by another language compiler. The result is an EXE or DLL, containing the IL code, which is saved to disk. VS.NET comes with different language compilers to generate IL code. Then on execution, the IL code and any requested functionality from the .NET base classes is brought together. The Just In Time (JIT) compiler processes the combined code creating managed native code (Code that targets the runtime is called managed code) which is passed to the CLR. The runtime automatically handles managing the execution environment of .NET (managed) code, including memory allocation and thread management, as well as enforcing security policies. Because the CLR automates these development tasks, development time is reduced and development tasks are simplified. For example, automated garbage collection means that you no longer have to worry about memory leaks. Some of the key components of the CLR are shown in Figure 3.3.

Figure 3.3

Department of MCA, NMAM -IT, Nitte

Microsofts .NET Technology

Older applications that are not .NET aware (unmanaged applications) will continue to work with Windows as they always have done. The Figure 3.4 captures the difference between managed and unmanaged applications. Figure 3.4 C# VB.NET VC++.NET .NET aware languages

VB

VC++ .NET Runtime & .Net base classses

Windows Operating System & Windows API

.NET Base Classes


.NET supplies a library of base classes that developers can use to implement applications quickly. Developers can use them by building objects from these classes and invoking the class methods. Alternately they can derive new classes from these standard classes. These classes include:

(a) Classes and types related to basic database management. (b) Classes and types related to GUI development. (c) Classes to debug an application and to trace the execution. (d) Types that allow reading/writing to files and other data streams. (e) Members to calculate common mathematical quantities. (f) Types, which enable security capabilities.

User And Language Interfaces:


This forms the top layer in the .NET architecture. All of the .NET languages employ the .NET Common Language Runtime (CLR) and Base Class Library (BCL), applying a common set of minimum features defined by the Common Language Specification (CLS). Each language also supports the Common Type System (CTS) providing cross-language compatibility. While certain languages natively support the CTS, others such as Managed C++ provide support through extensions to the base language. The Common Language Specification (CLS) is the common subset between languages of the Common Type System (CTS), codified as a set of rules. Languages conforming to these rules can completely interoperate with one another. For example, you can create a base class in C#, and derive a new class from it using Visual Basic.Net.

Department of MCA, NMAM -IT, Nitte

Microsofts .NET Technology

This high degree of language interoperability fundamentally affects the way you choose programming languages and implement designs. The language choice becomes more one of personal preference and depends upon the syntax that you feel most comfortable with. The CLR may also catalyze broader acceptance of niche languages, because they will have the same capabilities as more mainstream languages. Figure 3.5 shows a more detailed map of the .NET framework.

VB

C++

C#

JScript

Common Language Specification Visual Studio .NET

ASP.NET

Windows Forms

ADO.NET and XML Base Class Library Common Language Runtime Windows COM Services
Figure 3.5

4. Why .NET Makes Sense?


If we take a peek at how Windows technologies have evolved over the last decade or so, we would notice that it has been all along a process of slow (and at times painful) evolution. For example, COM (Component Object Model) originated as OLE (Object Linking and Embedding). In the initial days OLE was to a large extent, a means to link different office documents together. From that it evolved into COM, DCOM and finally COM+. Likewise Visual Basic made its debut as a way of placing useful controls into an application. It slowly graduated into a complete development language. Similarly Software Development Kit (SDK) evolved into Microsoft Foundation Classes (MFC). Though new technologies like Active Template Library (ATL) have made their appearance, the emphasis has also been on extending the capabilities of existing technologies. The primary reason for this has been an attempt to ensure backward compatibility. Though the backward compatibility in itself is good, it also makes coding

Department of MCA, NMAM -IT, Nitte

Microsofts .NET Technology

for new technologies difficult. For example, at times even experienced developers find the learning curve too steep. One may argue that Visual Basic does avoid complexities, but then Visual Basic is unable to utilize the flexibility offered by Windows API. .NET is about revolution rather than evolution. One such revolution occurred when the world moved from sequential programming under DOS to Event-driven programming under Windows. Another has come in the form of .NET. It was becoming increasingly difficult for Microsoft to keep extending tools and languages to meet the conflicting demands of exploiting the features of new hardware and language developments and still maintains the backward compatibility. The languages, tools and the environments all were showing signs of strain. It was time to begin with a clean slate. And this fresh start is what .NET and C# is all about. .NET is a new framework for programming on Windows and C# (pronounced as C Sharp) a new language that has been designed to work on .NET. Microsofts experience in the developer environments gathered over the last two decades reflects in the .NET framework. Likewise, a deeper understanding of Object-Oriented Programming (OOP) reflects in C#. However, note that the backward compatibility has not been lost entirely. Existing VC++ and VB programs would continue to work. So also would the COM components. VC++ and VB have been enhanced to be able to exploit the capabilities of the .NET framework.. However, in many cases where fresh development has to be undertaken, coding in C# would be easier and efficient than using VC++.NET or VB.NET. future. Lets now see why would .NET become a popular development environment in

Language Of Choice:
A developer can pick the .NET language that he likes most, write components in it, and share the compiled binary version of his component with other developers using other .NET languages. As on date there are 22 languages including VB, C++, C#, COBOL, etc. from which the programmer can choose. Microsoft has made the specifications for .NET development platform freely available to compiler vendors in the form of Common Language Specification (CLS). Vendors can develop compilers that produce standard binary code conforming to the CLS.

COM allowed different programming languages to interoperate with one another. .NET takes this a step further. It allows languages to be integrated with one another. For example, it is possible to create a class in C++ that derives from a class implemented in Visual Basic. This is possible because .NET defines and provides a type system common to all .NET languages. The language interoperability lets us develop different modules of an application in different .NET compatible languages. All these languages even share the same development environment.

Consistent Programming Model:


All application services are offered via a common object-oriented programming model, unlike today, where some OS facilities are accessed via DLL functions and other facilities are accessed via COM objects.

Department of MCA, NMAM -IT, Nitte

Microsofts .NET Technology

Less Plumbing Code:


VS.NET development environment eliminates a lot of plumbing code required by Win32 or COM applications. Developers no longer need to gain an understanding of the registry, GUIDs, IUnknown, AddRef, Release, HRESULTs, and so on. It is not that .NET has abstracted away these concepts from the developer; these concepts simply do not exist in .NET. .NET provides wizards, liberal use of drag & drop functionality and standard classes that developers can use to create powerful applications quickly.

Platform Independence:
Any Java program runs under a Java Virtual Machine. So for any new platform if a JVM exists then the Java program is guaranteed to run on that platform. Same is true about .NET. Once written and built, a .NET application can execute on any platform that supports the .NET common language runtime. As of now the Common Language Runtime is available for Windows only. This includes Windows NT 4.0, Windows 2000, Windows XP, and soon a 64-bit version of Windows 2000. Most of these systems run on x86 CPUs. It is even possible that a version of the common language runtime could be built for platforms other than Windows in the future. Even though Microsoft doesnt say so, this appears to be a silent preparation for the future where the software developed for .NET would be portable to a wide variety of Hardware and Operating System. You can appreciate the value of this broad execution model, as applications are increasingly required to be able to run on multiple computing hardware configurations or operating systems.

Automatic Resource Management:


While programming, we are required to manage resources such as files, memory, screen space, network connections, database resources, and so on. Unless sufficient care is taken to free these resources when their purpose is over, the application may misbehave at some unpredictable time. The .NET common language runtime automatically tracks resource usage, guaranteeing that your application never leaks resources. In fact, in .NET there is no way to explicitly free a resource.

Security:
Traditional OS security is based on restricting/granting access based on user accounts and user role. This is a fairly reliable model but it assumes that all code is equally trustworthy. This assumption was justified when all code was installed from physical media (such as CD-ROM) or trusted corporate servers. But with the increasing reliance on mobile code such as Web scripts, Internet application downloads, and e-mail attachments, there is a need for finer control of application behavior. The .NET Code Access Security model delivers this control.

Easy Deployment:
Though Dynamic Link Libraries (DLLs) help save disk space and memory by letting different applications share the same code, their usage leads to two problems:

Department of MCA, NMAM -IT, Nitte

10

Microsofts .NET Technology

(a) When a new version of DLL is used to overwrite an earlier version there is a danger
of breaking existing s/w. It is very difficult to track down such versioning problems.

(b) A DLL developed in one language may not be usable by another language.
Both these difficulties where avoided in COM. However, in COM the description of methods and interfaces is stored in type-library, GUIDs (Globally Unique IDs) are stored in registry, and the COM component is stored in some folder. This spreading out of information may make some information go out of sync. Uninstalling such applications/components is also pretty difficult. This has been avoided in .NET using what are known as assemblies. Deployment in a .NET environment involves merely copying files to a directory and uninstalling it is as easy as deleting those files. There are no versioning problems as all the version information is included in the metadata (data about data) that is distributed with the component. Even different versions of the same component can run side by side on the same machine. .NET promises that if the application runs after installation, then the application would always run. This puts an end to the DLL Hell.

Improved Dynamic Web Page Support:


Earlier web sites were static in nature because they were merely collections of HTML pages. A need was felt to create HTML pages dynamically (and programmatically) as per the users request. Under Windows platform, creation of such dynamic web pages was done using ASP (Active Server Pages) scripts. Though we can write powerful ASP scripts it still suffers from two limitationsit is an interpreted scripting language and it is non object-oriented. .NET eliminates these difficulties. The code in the dynamic web pages is compiled and can be written in a .NET aware language like C#. This technology is known as ASP.NET and it processes browser requests in a more efficient manner.

Support For Web Services:


In the next few years, lot of software components would become available in the form of Web Services. Some examples can be: service to calculate tax, service to get weather report, service to track shipment, service to evaluate credit card, etc. The clients will have to simply subscribe to these services to be able to use them. Before .NET, Microsoft provided limited support for web services through the SOAP (Simple Object Access Protocol) toolkit. .NET offers extensive support for developing web services.

Stability:
We learned that the common language runtimes garbage collector manages memory. How does this improve stability? By automating memory management, it eliminates one of the most common sources of system failures (and of development headaches)the memory leak. The garbage collector also dramatically simplifies the development process by relieving the developer from the need to manually track memory use. Not only can you wave goodbye to the memory leak, but to DLL compatibility issues as well! In .NET, solutions are packaged and delivered in an assembly. In a nutshell, assemblies are a box into which the software vendor dumps all his components. It is a self-contained, self-documented deployment model that is restricted from interfering with other programs or assemblies. While one assembly can use components or services of another, it cannot replace anything that is not in its own box.

Department of MCA, NMAM -IT, Nitte

11

Microsofts .NET Technology

Additionally, because the Framework exposes system functionality through its System namespaces and enables you to derive your own specialized version from any other namespace, overwriting operating systemcritical libraries is impossible!

5. Criticism to .NET
Some concerns and criticisms relating to the .NET Framework include: The introduction of the .NET Framework has resulted in many changes to Microsoft development tools and languages. Some of these changes are controversial, especially for developers transitioning from an earlier version of a Microsoft product. Additionally, there were numerous backward incompatibilities between .NET 1.0, .NET 1.1, and .NET 2.0. Applications running in a managed environment such as the Microsoft framework's CLR or Java's JVM tend to require more system resources than

Department of MCA, NMAM -IT, Nitte

12

Microsofts .NET Technology

functionally similar applications that access machine resources more directly. However, due to the Just-in-time optimization in the VM, some applications run even faster than their native counterparts that have been optimized beforehand. This has been shown e.g. in IronPython and Phalanger projects and also even in raw computational power requiring FFT transform. Usually applications that require maximum performance or precise timing of operations would be written in C, unmanaged C++, or other languages that emphasize performance. Although it is more a business decision than a real criticism on the framework, some people have expressed concern that the framework is too much tied on the Microsoft Windows operating system (see for example Bjarne Stroustrup's homepage). However, the existence of the alternative implementations for other platforms (although not complete yet) would seem to alleviate this criticism. There is also concern in the development community about the fact that a .NET assembly, as produced by the .NET programming environments, can be reverseengineered to reveal some of the programming techniques and algorithms used by an application. While this kind of reverse-engineering is possible with all programs, those that compile to byte-code, as .NET and Java do, are somewhat more vulnerable. Reverse engineering can lead to the loss of valuable intellectual property and the bypassing of licence control mechanisms. Some developers are using obfuscation and other techniques in an attempt to protect their intellectual property and license revenues. Indeed Microsoft includes a tool called the "dotfuscator community edition" - a product of PreEmptive Solutions, in the full version of Visual Studio 2005.

6. Alternative implementations
The Microsoft .NET Framework is the predominant implementation of .NET technologies. Other implementations for parts of the framework exist. Since the runtime engine is described by a ECMA/ISO specification, other implementations of it are unencumbered by copyright issues. It is more difficult to develop alternatives to the base class library (BCL), which is not described by an open standard, and may be subject to copyright restrictions. Additionally, parts of the BCL have Windows-specific functionality and behavior, so implementation on non-Windows platforms can be problematic. Some alternative implementations of parts of the framework are listed here.

Department of MCA, NMAM -IT, Nitte

13

Microsofts .NET Technology

Microsoft's Shared Source Common Language Infrastructure is a shared source implementation of the CLR component of the .NET Framework. It runs on Microsoft Windows XP, FreeBSD, and Mac OS X 10.2. Portable.NET (part of DotGNU) provides an implementation of the Common Language Infrastructure (CLI), portions of the .NET Base Class Library (BCL), and a C# compiler. It supports a variety of CPUs and operating systems. Mono is an implementation of the CLI and portions of the .NET Base Class Library (BCL), and provides additional functionality. It is dual-licensed under free software and proprietary software licenses. Mono is being developed by Novell, Inc. It includes support for ASP.NET, ADO.NET, and evolving support for Windows Forms libraries. It also includes a C# compiler, and a VB.NET compiler is in prebeta form.

7. Conclusion
The evolution of the Internet, consumer devices, communications, and server technology is providing for the development of new integrated user experiences through the use of the next generation of software. This software will provide the platform to develop the next generation of Internet-based applications. These applications will seamlessly interact with one another through XML Web Services, and will provide users with precisely the personalized information they require, at any time, from any place, using any client device. .NET is Microsofts platform, the next generation of software that connects our world of information, devices and people in a unified, personalized way. The .NET

Department of MCA, NMAM -IT, Nitte

14

Microsofts .NET Technology

platform enables the creation and use of applications, processes, and Web sites as services that share and combine information and functionality with each other by design, on any platform or smart device, to provide tailored solutions for organizations and individual people. The .NET platform includes a comprehensive family of products, built on industry and Internet standards, that provide for each aspect of developing (tools), managing (servers), using (building block services and smart clients) and experiencing (rich user experiences) XML Web services. .NET will become part of the Microsoft applications, tools, and servers you already use today as well as new products that extend XML Web service capabilities to all of your business needs. For software developers, the .NET Framework is one of the most significant changes to the Windows platform since its introduction. It brings into the operating system features and responsibilities that previously had been provided individually by programming languages and tools from various sources. The incorporation of the features into the operating system offers a number of advantages, including: Assuring the availability of framework features to all programs written in any of the .NET languages. Providing to programmers a common means of accessing framework features, regardless of programming language. Guarantees of a common behavior within the framework, regardless of programming language. Allowing the operating system to provide some guarantees of program behavior that it otherwise could not offer. Reducing the complexity and limitations of program-to-program communication, even when those programs are written in different .NET languages.

8. Future
In an interview with Channel9, Jason Zander, general manager of the .NET Framework team at Microsoft, discussed the version of the framework that will follow version 2.0. Tentatively titled "version 3.0", this version will include a new set of managed code APIs that are an integral part of the upcoming Windows Vista operating systems, a new compiler that will support new features such as Language Integrated Query, as well as new language features in C# and VB.NET. .NET Framework 3.0 consists of four major new components:

Department of MCA, NMAM -IT, Nitte

15

Microsofts .NET Technology

Windows Presentation Foundation (WPF), formerly code-named Avalon; a new


user interface subsystem and API based on XML and vector graphics, which will make use of 3D computer graphics hardware and Direct3D technologies.

Windows Communication Foundation (WCF), formerly code-named Indigo; a


service-oriented messaging system, which allows programs to interoperate locally or remotely similar to web services.

Windows Workflow Foundation (WWF) allows for building of task automation


and integrated transactions using workflows.

Windows Card Space (WCS), formerly code-named InfoCard; a software


component which securely stores a person's digital identities and provides a unified interface for choosing the identity for a particular transaction, such as logging in to a website.

.NET Framework 3.0 .NET Framework 3.0 would include version 2.0 of the Common Language Runtime. This version of the framework is slated to be included with the version of Visual Studio following the 2005 release (Codenamed Orcas).

9. References
[1] Programming in C# - E Balagurusamy [2] http://www.microsoft.com/net [3] http://msdn.microsoft.com/net [4] http://www.GotDotNet.com [5] http://www.asp.net

Department of MCA, NMAM -IT, Nitte

16

Microsofts .NET Technology

[6] http://www.ineta.org

Department of MCA, NMAM -IT, Nitte

17

Вам также может понравиться