CSE 333
Fall 2002
Hardik Davé
Keith Bessette
Jaladhi Mehta
1 Overview
Microsoft has generated great deal of interest in its newly developed “.NET” products. The .NET initiative is Microsoft’s way of providing developers with the ability to capture the power of the Internet. .NET is a general purpose Platform that allows users to design, develop, deploy and use web based applications in a uniform and efficient manner. According to Microsoft, .NET will “transcend device boundaries and fully harness the connectivity of the Internet”. The obvious competitor to .NET is Sun Microsystems’s J2EE development platform. There are some obvious similarities between the two platforms as well as incredible differences in some areas. Our objective here is to research and analyze a few functionality and modules of .NET and J2EE. The areas we will specifically discuss include programming language capabilities and interactions, middleware connectivity and interoperability, data access abilities and security issues. We will demonstrate the Pros and Cons of Java and DOTNET in each area with sample application/s.
2 Introduction to Microsoft .NET
Microsoft .NET is a set of Microsoft software technologies that connect people, systems, devices, and data all across the Internet. .NET integrates software across networks and the Internet by using XML Web services. XML Web services provide the ability to build, host, deploy, and use secure and connected solutions. Along with XML Web services, developer tools, client applications, and servers are all provided by the Microsoft platform, and .NET is built into all of these. .NET includes language agnosticism, a managed execution environment, JIT compilation, and rich library support. The mission of .NET quoted from Microsoft is to: “transcend device boundaries and fully harness the connectivity of the Internet”.
The .NET Framework is the programming model for developing, deploying, and running XML Web services and applications that all underlies .NET. XML Web services are units of code that allow developers to write programs in different languages and use different platforms to communicate through standard Internet protocols like XML, SOAP, WSDL, and UDDI. The center of the .NET Framework is the common language runtime (CLR) and the class libraries. The CLR manages memory, security, and language integration. Other features of the CLR are strong type naming, cross-language exception handling, lifetime management, and dynamic binding. The class libraries are the resources used to build applications with XML support, networking, and data-access abilities.
3 NET Languages and JAVA
J2EE offers only JAVA as the only language for the platform, while .NET platform offers a number of languages for programmers to write code in, namely, C#, VB.NET, Jscript and Managed C++. To put in their own words, it is a Language-Agnostic Model. Though the environments take radically different views considering the languages in general, they coalesce nicely when it comes to C# and JAVA.
The C# language is an object-oriented language that lets the programmers to quickly build a wide range of applications for the Microsoft .NET platform. The goal of C# and the .NET platform is to shorten development time by freeing the developer from worrying about several low level plumbing issues such as memory management, type safety issues, building low level libraries, array bounds checking, etc. thus allowing developers to actually spend their time and energy working on their application and business logic instead. As a Java developer the previous sentence could be described as "a short description of the Java language and platform" if the words C# and the .NET platform were replaced with words Java and the Java platform.
3.1 Differences and Similarities(C# vs. JAVA)
Much of the progress so far that we have made in this areas includes an intensive research about the C# language, a study about its various features and comparing it to java with fallacies and benefits. JAVA and C# are two big languages, and though programmers from both camps will find understanding the other easy, there are some subtle differences here, which can be divided into 3 parts informally; similarities, differences, extensions.
There are some features, which are exactly similar in both languages like Runtime environments, Garbage Collection, Interfaces, Strings and Unextendable classes. While some features differ only in small ways or a syntax like Inheritance, Excess Modifiers, Reflection. Some features have some major conceptual differences like Nested Classes, Threads, Operator Overloading, Serialization, and Documentation generation. A few features of C# with no counterparts in JAVA like Deterministic Object Cleanup, Delegates, Boxing, Pointers and Unsafe Code, Pass by Reference. While there are certain JAVA features having no look-alikes in C#, like Extensions, Checked Exceptions, Dynamic Class Loading, Anonymous Inner Classes and above all Cross Platform Portability.
We have tried to look into a few areas out of those cited above, and analyzed how C# shape up in those areas, and compare the approaches of both languages when they both provide those features, and analyze the reasons why certain features don’t have their counterparts. As a part of future work we may look into a couple of more interesting features as well as we will provide Code Snippets to better illustrate the facts that we are citing here.
3.1.1 Class hierarchy
3.1.2 Execution environment
3.1.3 Object creation
3.1.4 Namespaces
3.1.5 Access modifiers
3.1.6 Reflection
3.1.7 Serialization and documentation
3.1.8 Deterministic object cleanup
3.1.9 Delegates
3.1.10 Boxing
3.2 C# and Interoperability
This is a part of our future work in which we would like to evaluate how much does C# scores in terms of interoperability with JAVA. Particularly, the areas which we will concentrate on include Cross-Platform compatibility of C# (as currently C# is only available for windows) as against the portability of JAVA on various platforms. Interoperability in terms of various Standards is also something we will look into as Microsoft has submitted C# to ECMA to arrive at a common language infrastructure. The Open Standards approach vs. Sun Java policies has opened up some interesting choices for the developer for the future.
4 Database Connectivity using .NET and JAVA
Database connectivity has been a prime area of competition among the two major developers of integrated development environments. Sun Microsystems and Microsoft both have spent great deal of resources in researching ideal way to let developers connect to databases. Today, almost all applications have database backend. These backend are not necessarily compatible with the platform that the application is developed for. It is important for users to get applications that work across various platforms in a unified and flawless manner. In order to achieve this kind of connectivity, Java came up with JDBC and Microsoft has developed ODBC and ADO/ADO.NET. Both, JDBC and ODBC/ADO has a great and long (in terms of Software years) history. Java does not have one extensive system to do perform all data related tasks. It performs different tasks using different modules. Relational database connectivity is done using JDBC, Offline data access and Persistent objects are provided by EJB Entity Beans and there is no support provided for Hierarchical data access. On the other hand, Microsoft has included all of the above usage in one single API called ADO.NET.
4.1 Differences and Similarities
There are many Differences and Similarities between Database access using J2EE or .NET. Our focus in this project is going to concentrate on three major issues relating to database access. Architecture issues are mostly related to the original design of Java Vs. Microsoft’s ability to tie .NET platform with its operating systems closely. Optimization is something that the SQL code writer has to focus on more than ADO.NET and JDBC users. In promoting .NET, Microsoft has given a lot of focus to its new offline database utility called DataSets. DataSets are smaller version of a relational database that lie in developer’s local machine and can be easily manipulated. Java does not provide a similar functionality through JDBC. This point is going to be beneficial to Microsoft and going to appeal to a lot of developers.
4.1.1 Architecture
ADO.NET has streamlined database connectivity issues by putting a middle tier of XML to interact with Web, Windows Apps or B2B applications. XML layer can in turn easily interact with Datasets and Data Adapter to gather data from the actual database. Appendix A contains a diagram for ADO.NET architecture. JDBC architecture is a little more complicated than that of ADO.NET. JDBC architecture does not deal with XML for its tier connections. Because of this reason, a special Connection and DriverManger objects have to be involved in making a connection. Appendix B contains a diagram for JDBC architecture.
4.1.2 Optimization
4.1.3 Offline Database Access using ResultSets and DataSets
4.2 Example and code discussion
4.3 Interoperability using XML w/ADO.NET
ADO.NET provides great interoperability using XML. XML has become a standard of choice for Microsoft product. .NET also provides great support for DataSets using XML. DataSets can be created from XML document as well as XML documents can be generated easily from Datasets. It is also possible to interact with Microsoft SQL Server using XML.
5 Security issues concerning .NET and JAVA
This section will discuss the security issues of .NET and J2EE. There will be detailed discussions of how each platform supports and maintains secure development and execution environments. The main components of these platforms that keep code, data, and systems safe from inadvertent or malicious errors are code based access control, role based access control, code verification and execution, secure communication, and code and data integrity.
Code based access control is giving permissions to code to access resources based on application or protection domain the code is assigned to, and evidences of the code. Role based access control is giving permissions to a user to access resources based on the user’s role in the system. Code verification and execution means to check the semantics, analyze bytecode, and to keep code execution within a domain. Secure communication is being able to pass data and messages locally or remotely in a secure manner, as to avoiding data modification or other such hacks. Code and data integrity is making sure code hasn’t been modified without authorization by using cryptographic solutions and signed distribution files.
5.1 Differences and Similarities
The differences and similarities of the security aspects outline below will be the focus of this section. Both .NET and J2EE have ways of dealing with these issues, sometimes they are implemented the same way, and sometimes they have totally different architectures. An example being .NET uses the Windows SSPI and IIS for secure communications, Java provides JSSE for a more flexible solution.
5.1.1 Code Based Access Control
5.1.2 Role Based Access Control
5.1.3 Secure Code Verification and Execution
5.1.4 Secure Communication
5.1.5 Secure Code and Data Protection
5.2 Example and code discussion
6 Interoperability
This is a section on which we will be concentrating the most from now on till the final report. In our future work in this section, we will look at interoperability of the .NET architecture as a whole in various aspects.
6.1 Languages interoperability
A detailed study about Language Independence in .NET, interoperability among its own languages as well as the support for other languages like Eiffel, VB.NET, as well as interaction with scripting languages, in a contrast to JAVA architecture. We will after sufficient analyses present Pros and Cons of both architectures.
6.2 Middleware Interoperability
We would further investigate middleware interoperability of .NET components. Particularly how .NET components interact with COM components, and its contrasting technologies in JAVA, Remoting in .NET vs. RMI/RPC, .NET components’ interactions with non-. NET components via SOAP/XML, and possibly .NET components interactions with CORBA/JINI.
7 Progress so far
A major part of our effort until now was concentrated on doing research on various aspects of .NET technologies, primarily because this topic is new for us. As indicated in the timeline below, much of our time between then and now was spent understanding the various areas of .NET technologies, particularly the ones outlined on sections 3, 4, 5. The effort was distributed between the three-team members with Jaladhi in charge of Languages, Hardik in charge of Database aspects, and Keith undertaking Security. The demarcation is more clearly presented in different sections undertaken by each of us namely sections 3, 4 and 5. Most of the effort by each of us was concentrated on gathering information through various websites, onsite tutorials, and books. While each of us was working in different areas, those areas were not totally isolated or demarcated, thus resulting in continuous communication and cooperation of each team member. Meetings were scheduled twice a week for formal discussions and exchange of ideas and information. We have added another section to our report covering interoperability. We had planned on going over interoperability in each individual section, languages, databases, and security, but decided to research interoperability more broadly, creating a new section, and making sections on interoperability in on C# and ADO.NET very specific.
Timeline (so far and future)
8 Future work
Our research is 95% done, and now each team member will continue to concentrate on their individual sections, analyzing code primarily, and will also help out with the new interoperability section (6). The last bit of research will be in general areas of interoperability that we feel we should cover. We’ve each researched .NET from a different aspect, and a unified effort in the interoperability section should benefit from that.
9 References
General
Comparing Microsoft.NET and the Java Environment –
http://www-wi.fh-reutlingen.de/dbtech/lectures/dotNET_Chappell.pdf
Dotnetguru - http://www.dotnetguru.org
J2EE vs. The .NET Platform - www.objectwatch.com/FinalJ2EEandDotNet.doc
J2EE vs. Microsoft.NET - www.theserverside.com/resources/pdf/J2EE-vs-DotNET.pdf
Microsoft Developer’s Network- http://msdn.microsoft.com/
Language Comparison
C#: http://www.ehhco.com/csharp/cintro.htm