Pages

1/16/2008

.NET vs. Java and Java EE

.NET vs. Java and Java EE

See also: Comparison of the Java and .NET platforms and Comparison of C# and Java

The CLI and C# have many similarities to Sun's JVM and Java. They are strong competitors. Both are based on a virtual machine model that hides the details of the computer hardware on which their programs run. Both use their own intermediate byte-code, Microsoft calling theirs Common Intermediate Language (CIL; formerly MSIL) and Sun Java bytecode. On .NET, the byte-code is always compiled before execution, either Just In Time (JIT), or in advance of execution using the ngen.exe utility. With Java the byte-code is either interpreted, compiled in advance, or compiled JIT. Both provide extensive class libraries that address many common programming requirements, and both address many security issues that are present in other approaches. The namespaces provided in the .NET Framework closely resemble the platform packages in Java EE API Specification both in style and invocation.

.NET in its complete form (Microsoft's implementation) is currently only fully available on Windows platforms and partially available on Linux and Mac,[23][24][25] whereas Java is fully available on nearly all platforms.[26] From its beginning, .NET has supported multiple programming languages, and at its core remains platform agnostic and standardized so that other vendors can reimplement it on other platforms (although Microsoft's implementation only targets Windows, Windows CE, and XBox based platforms). The Java platform was initially built to support only the Java language, but on many operating system platforms under the slogan, "Write once, run anywhere.".

Sun's reference implementation of Java is becoming open source (including the class library, the compiler, the virtual machine, and the various tools associated with the Java Platform) under the copyleft GNU GPL license.[27]

The third-party Mono Project, sponsored by Novell, has been developing an open source implementation of the ECMA standards that define the .NET Framework, as well as most of the other non-ECMA standardized libraries in Microsoft's .NET. The Mono implementation is meant to run on Linux, Solaris, Mac OS, BSD, HP-UX, and Windows platforms. Mono includes the CLR runtime, the class libraries, and compilers for C# and VB.NET. The current version supports nearly all the APIs in version 1.1 of Microsoft's .NET and almost 96% of the APIs in version 2.0 of Microsoft's .NET. Support for the additional libraries in .NET 3.0 and 3.5 is ongoing, and currently in the early alpha stages. Support for C# 3.0 and Linq is also in early alpha at this stage. [28]

[edit] Disadvantages

Some concerns and criticisms relating to .NET include:

  • Applications running in a managed environment such as the Microsoft framework's CLR or Java's JVM tend to require more system resources than functionally similar applications that access machine resources more directly. However, some applications have been shown to perform better in .NET than in their native version. This could be due to the runtime optimizations made possible by such an environment, the use of relatively well-performing functions in the .NET framework, JITting of managed code, or other aspects of the CLR.[29][30]
  • As JIT languages can be more easily reverse-engineered than native code to algorithms used by an application, there is concern over possible loss of trade secrets and the bypassing of license control mechanisms. However, many obfuscation techniques already developed can help to prevent this; indeed Microsoft's Visual Studio 2005 includes such a tool produced by PreEmptive Solutions (see dotfuscator).
  • In a managed environment such as the Microsoft framework's CLR or Java's JVM, the regularly occurring garbage collection for reclaiming memory suspends execution of the application for an unpredictable lapse of time (typically no more than a few milliseconds). This makes such environments unsuitable for some applications, such as those that must respond to events with sub-second timing.
  • Since the framework is not pre-installed on older versions of Windows, an application that requires it must verify that it is present, and if it is not, guide the user to install it. This requirement may deter some from using the application.

[edit] 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.

  • 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 pre-beta form.
  • CrossNet is an implementation of the CLI and portions of the .NET Base Class Library (BCL). It is free software. It parses .NET assemblies and generates unmanaged C++ code that can compiled and linked within any ANSI C++ application on any platform.

[edit] Support End of Life

.NET Framework 1.0: Mainstream support ended June 30th, 2007, extended support ends June 30th, 2009.

.NET Framework 1.1: September 30th, 2008 and September 30th, 2010 respectively. Since .NET 1.1 is a component of Windows Server 2003, extended support for .NET 1.1 on Server 2003 will run out when the OS does, currently June 30th, 2013.

No comments: