当前位置:编程学习 > C#/ASP.NET >>

.NET Framework For Java Programmers ---1(Good)

答案:

.NET Framework For Java Programmers
Author: Ashish Banerjee

Objective

After reading this article Java programmers should be able to decipher and de-jargonize the .NET architecture and relate it with the proposed ECMA standard.
  

Target Audience

Java programmers and system architects.

Summary

This article outlines Microsoft's proposed standardization of .NET framework in ECMA forum as CLI (Common Language Infrastructure), but the Microsoft documentation refer this as CLR (Common Language Runtime). The CLR and JVM are compared with respect to market forces which shaped the CLR definition. Components of CLR are examined followed by details of Microsoft's implementation of the CLR as the .NET framework.
All along .NET framework is compared with Java architecture.
The material is derived from author's own experience with Java since early 1996, Microsoft's MSDN site and standard documents from sites like ECMA and W3C.org.

Overview

.NET framework is the Microsoft's answer to Java commune's objections to  \"Windonization\" of Java.
Microsoft introduces a new language C#, designed by the Visual J++ team. But in the process it has done away with DCOM and also have changed it's flagship language Visual Basic.
In a nutshell, .NET constitutes presently of three compiled languages C#, VB.NET and C++, a Java like runtime virtual machine environment, five execution containers hosting this runtime, namely: ASP.NET, Windows Shell, VBA scripting host for Office suite, Visual Forms container and IE (Internet Explorer). Much like Java it contains a rich set of API and lib.
Enhancements over Java framework include use of SOAP (Simple Object Access Protocol) for remoting. Version and security scoping using concept of Application Assembly (described later). A Common Type System is introduced for 易做图 mixed language programming easier. For example a VB component can inherit from a C# class.
In longer term Java and .NET will converge and therefore an overview of the new framework is presented here from Java programmer's perspective.

Comparing  CLR with JVM

The .NET framework's Common Language Runtime (CLR) is much similar to Java Virtual Machine (JVM), in terms of garbage collection, security, just in time compilation (JIT).
However, the fundamental difference arises from the variance in perception of the Sun's Java design team headed by James Gosling and that of Microsoft's C# designers spear headed by Anders Hejlsberg
Sun viewed the Internet as an heterogeneous network consisting of multiple operating systems. Thus Sun had to design the GUI as the least common factor, supportable by all such platform. This was also the major reason of Java's failure in client side applications. Java has been successful only on server side where there is no great need for GUI.
Having failed at client side desktop application arena, Sun is now targeting Java to server side applications market, which is dominated by Unix and Linux flavors having approximately 60% of the server market, the rest 40% rests with Windows NT.
But this view was not conducive to Microsoft, which holds about 90% of client side desktop market. Microsoft wanted to provide a window centric Internet development platform. Thus it added a few Window specific features in it's Java implementation, similar to what it had had done with it's C++ implementation. This along with Microsoft's refusal to support Java RMI, which competed with it floundering remoting technology called DCOM, resulted a law suite. Microsoft lost the law suite in late 2000, and had to pay USD 20 million  to Sun as settlement amount. This antagonist attitude made Microsoft break away from Java and float it's own language called C#.
The C# team was carved out of the Microsoft J++ team, and it's effort finally led to the creation of .NET framework.
Microsoft intends to leverage it's desktop leadership, to shape the Internet applications development by introducing the .NET framework. Thus the supported languages map the Windows GUI more closely in it's framework, much similar to C++ MFC and J++ WFC (Windows Foundation Classes). In spite of the platform independence design claims, all the three supported languages produce windows .exe code by default.
Microsoft played the standardization game better than Sun. Microsoft, though being an USA based company proposed the C# and Common Language Infrastructure (CLI), the back bone of .NET framework, for standardization with ECMA (European Computer Manufacturing Association) TC39 Technical Committee in October 2000. Ironically Sun also happens to be a member of this standing committee, which looks after computer languages related standardization issues. See http://www.ecma.ch.
Microsoft has also successfully standardized Simple Object Access protocol (SOAP) through W3C (http://www.w3c.org). SOAP is a XML and HTTP based remote object access protocol. SOAP competes with Java's RMI and Microsoft's own DCOM. RMI has the limitation of being  language specific, and DCOM had limited acceptability outside the Windows community, this was, despite the best of Microsoft's effort to port DCOM on Unix platforms.
CORBA, another remoting contender, which even has internet specific transport namely IIOP, is more or less dead, due to it's vendor non interoperability.
SOAP, by virtue of HTTP transport can operate easily over firewalls and  therefore can easily transident LAN and Internet. However, SOAP being XML based,  burdens both client and server for XML parsing, which is relatively CPU intensive, compared to binary protocols like RMI and DCOM.
Java platform views the Internet  world as one language running on different operating systems (OS), whereas .NET framework views the world running on one OS with a programmers having choice of  multiple languages. Therefore Java platform interpolates multiple operating systems, and .NET framework interpolates multiple languages.
Apparently from the above discussion, the market forces are largely responsible for the state-of-the-art rather than technical design considerations.

Inside The Common Language Runtime

The Common Language Runtime (CLR), is the runtime environment of the .NET framework, which manages the execution of code and provides services.
The Common Language Runtime (CLR), is also proposed for ECMA standard. However, The ECMA documents refer the CLR as  Common Language Infrastructure (CLI). It has five components namely:
  
  • CTS - Common Type System
  • CLS - Common Language Specification
  • CIL - Common Intermediate Language
  • JIT   -  Just in Time Compiler
  • VES - Virtual Execution System

CLI - Common Language Infrastructure

The Common Language Infrastructure (CLI) provides a language neutral platform for application development and deployment. CLI supports both Object Oriented Paradigm (OOP) as well as hooks for modeling procedural and structured languages.
CLI provides languages with a framework for security, garbage collection, exception handling and also provides a platform for language interoperability. For example C# objects can inherit from C++ classes and VB procedures can use the C# components.
Please Note that the Microsoft documentations refer CLI as CLR (Common Language Runtime).
After reading through the ECMA standard documents, like me, you will probably develop the feeling that CLI is an attemp

上一个:Oracle 临时表空间使用注意
下一个:.NET Framework For Java Programmers ---2(Good)

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,