Welcome to Abstract

MSc

CASTING THE .NET
 

Technical Support

ABSTRACT

To be able to write programs once and then execute them on any platform is a highly desirable attribute for a computer language. Achieving this in a non-interpreted language has been something of a Holy Grail for computer language designers. The general strategy has been to design a language that compiles to a standard byte code: the byte code is then interpreted by a virtual machine constructed for the particular platform on which it is to run. The virtual machine translates the byte code common to all platforms, to the platform specific machine code necessary to execute the program. Languages designed in this way are therefore able to run anywhere where there exists a virtual machine that can execute their byte code.

Java, with its clean implementation of object-oriented features proved to be a successful implementation of this idea. One of the reasons for its success was that it was a network-centric programming system and so it caught the wave of interest in creating programs that were layered, with different parts running on different computers - n-Tier applications. It also provided facilities to develop Web-based applications that took advantage of such layering by housing the application's logic on the Web, and other, servers. Such a strategy not only allowed Web applications to be made up of logically discrete components, but it also brought about major security improvements by taking business logic off the Web server and - even more importantly - off the client (browser). Sun and Microsoft disagreed as to how some of these features should be implemented. The resulting lawsuit saw Microsoft forced to drop its "improvements" to Java and conform to Sun's specification. The result was that Microsoft stopped producing a Java Virtual Machine and went on to produce its own, competing product - the .NET Framework.

Microsoft's .NET Framework is Windows-centric; but its C# language, and Common Language Infrastructure now form international, ECMA/ISO standards. It is therefore possible to produce other implementations and this has happened, most notably with Mono from Ximian (now part of Novell).

So is it possible to produce cross-platform, secure, distributed, n-Tier systems using the .NET Framework; and if so, are there any performance penalties resulting from running .NET code on non-Microsoft platforms?

This project looks at two implementations of .NET - Microsoft's own, and Mono - and implements an example Web application and an example console-based application using the same code on both Windows and Linux. A number of considerations for writing cross-platform code, discovered during the project, are presented and a comparison is made of the running times of the applications using the .NET Framework on Windows, versus the Mono virtual machine on Linux. Other comparisons between the two implementations are also introduced and discussed in the light of the findings from the test application.

Version 1.0, Release 1.0 <: MESSAGES :>