When I was looking for the advantages of using ASP.NET
, I found a Web page titled ‘Why choose ASP.NET vs J2EE
’ in the Ask Philip Forum
of Philip Greenspun’s Website
. This rather lengthy page starts with a question posted in 2002 asking why MIT had chosen .NET over J2EE as the toolkit for developing Internet applications. Then it archives all the answers from different contributors up to March 2006 -- a discussion which has gone on for 4 years!
After going thru this page, I have picked up the following points.1. .NET requires a shorter development time
Although J2EE allows a developer to choose different components (e.g. operating systems, development environments, databases, web servers, servlet engines and application servers) in building an application, this freedom of choice comes with a price.
For example, for persistence, a developer has to decide between Hibernate, EJB3, JDO, etc. It may involve reading up on each technology, doing demos and comparisons, etc.
To use ASP.NET, there is only one choice – the Windows platform, which is not a bad platform compared with those provided by J2EE.
In Philip Greenspun’s answer to the title question, he said: “My students who elected to use Microsoft .NET tools spent an average of two hours setting up their systems. Those students who elected to go the J2EE route wasted two weeks and ended up having to drop the course because they couldn't get their application servers up and running (despite the fact that all of these students had at least one semester of Java programming experience).”2. J2EE is not 100% platform independent
There are subtle differences in running J2EE under different application servers and execution environments. E.g. J2EE built for WebLogic won’t run under Tomcat or Websphere. To switch between these platforms, developers may have to change 1% of the code, but it is not obvious which 1% needs to be changed.
While it is true that ASP.NET ties an application up in the Microsoft environment and does not offer the flexibility that J2EE does, at the same time it lends itself to fewer headaches.3. The .NET framework is language Independent
The .NET framework is not tied to any particular computer language, recognizing that an organization may have a diversity of programmers and therefore a diversity of programming languages.
This feature is provided by .NET’s Common Language Infrastructure (CLI)
. Every .NET compatible language is compiled to a platform-neutral language called Common Intermediate language (CIL)
. Microsoft’s implementation of CIL is known as Microsoft Intermediate language (MSIL)
. Any source code compiler that emits MSIL can be used to create assemblies which can be executed by Microsoft’s Common Language Runtime (CLR)
. Hence, CLR supports both object-oriented and procedural languages. There are currently over 40 languages with compilers for the .NET framework.
Of course, J2EE uses the Java language exclusively, which is a difficult language to master.4. The coding for .NET is easier than that for J2EE
ASP.NET has tools for creating server side controls and is easy for validation control.
Since ASP.NET supports event-driven programming, developers can understand and debug the coding in less time.
ASP.NET is not so case-sensitive as Java.5. Is .NET more expensive?
One may say that a company has to pay license fee to Microsoft for using .NET, whereas the cost of using J2EE may be zero when open source components are used. However, the longer development time required by J2EE may increase labor costs, and the delaying of time-to-market may have an opportunity cost.