Why choose ASP.NET vs. J2EE ?
this thread was reprinted from
http://philip.greenspun.com
Philip,
I'm trying to understand why MIT would have chosen .NET over J2EE as the
toolkit for developing Internet applications. MIT comes from the open-source
and Unix world (and a lot of people there do anything they can to avoid
anything Microsoft-related), so it would make sense for them to choose a more
vendor-neutral platform (e.g., Apache/Tomcat/Java) and all the other open
development tools available.
Would that be a fashion statement as well? What are the particular advantages
of .NET over J2EE that made it the superior choice? In my mind, I would look at
a solution that didn't require paying Microsoft's excessive licensing fees, and
that used as much open- source software as possible.
And what about security? A poorly-configured Apache server can be as bad as a
poorly configured IIS server, but isn't it apparent that .NET servers will be
less secure than their open-source counterparts (given the security track
record of Microsoft products -- at least in the short term)?
-- Marcelo P. Lima, April 10, 2002
Answers
MIT as a whole is pretty wealthy but individual IT budgets tend to be
modest. With only $1 or $2 million to spend per system MIT needs to put its
money into capabilities that are valued by end-users. A true J2EE system would
involve EJB and container-managed persistence. All of that automatically
generated SQL code from the application server can be 100X slower than
hand-authored SQL, which means MIT would have to buy 100 times as much
computing hardware to support the same application. Not to mention that
projects that built on top of J2EE are famously unproductive, expensive,
behind-schedule, and inflexible. If you had a $20 million, 3-year budget to
build something simple like photo.net, you could certainly do it with J2EE (or
raw C with the Oracle C library for that matter). But MIT needs to produce
things sort of like photo.net with a few undergrads hacking away over a summer.
And they need to be able to tear down 20 percent of it and add another 50
percent the next summer as ideas evolve.
J2EE also looks like a classical IT dead end. There are dozens of different
application servers and execution environments for Java. All have subtle
differences so that an application built for, say, WebLogic won't run under
Tomcat or Websphere. Maybe the application be ported by changing only 1 percent
of the code but it isn't obvious which 1 percent. This is the same situation
that Unix presented in the early 1990s. An AIX application wouldn't just work
on SunOS or HP-UX. Close but not compatible. Faced with all of these choices,
most application developers chose to develop only for Windows. In the amount of
time it would take MIT to evaluate and select the right Java application
server, V1.0 of a system could be built and launched using the Microsoft tools.
Anyway, it wasn't my decision. I'm a humble volunteer teaching one class out of
nearly 1000 classes. The MIT bigwigs don't come down through the ranks to ask
for my advice and I don't offer it unsolicited. But certainly if the decision
makers came to my 6.171 classroom they would not find any support for using
J2EE. About half the class elected to use the Microsoft .NET tools. The other
half of the class is using simple Java Server Pages. Not a single graduate of
the course will be experienced with programming in any J2EE environment. So if
MIT wants something that can be maintained and extended by its students and
graduates, Microsoft .NET is a logical choice for that reason as well.
(Your security question is beyond my area of expertise. I guess I'd be prepared
to believe that both WinXP and Unix/Linux will require substantial sysadmin
investments to be kept secure and that neither can be left unattended.)
You raise some good points about Microsoft licensing fees but they don't apply
to MIT. We get most things for free or cheap. We don't need too many CPUs
because we have fewer than 10,000 students. It is not as though we need to rack
and stack thousands of machines. If I were building something that I wanted to
give away to every organization in a Third World country I'd ask myself if a
Microsoft world in which the basic software costs more than the hardware made
sense. But if I were building something to sell to big companies, I'd build it
on Microsoft .NET because I could be sure that they would have Windows servers
and even if I liked J2EE I would never be able to know in advance which variant
of J2EE they'd adopted.
-- Philip Greenspun, April 11, 2002
Ben:
In response to your message below... The J2EE zealots seem to think that a
two-tier straightforward and understandable JSP site is not "true J2EE". Jin
Choi and cohorts did a nice JSP version of ACS 3.4 and people complained that
it wasn't "sufficiently J2EE" because you could still recognize some fragments
of SQL and HTML in the code.
The vast array of choices that you see as an advantage for J2EE I see as a
disadvantage. If I were paying a group of programmers, I'd want them solving my
users' problems, not evaluating different "operating systems, development
environments, databases, web servers, servlet engines, and application
servers". The end user can perceive only data model and page flow. I would want
all of my programmers' energy focussed on these challenges and not on the
tools. 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).
As for your long run argument, Ben... I noted that J2EE did not seem viable for
the long run due to the plethora of incompatible systems. But I forgot to
mention that the most serious problem for J2EE's long-run viability: the Java
language. The idea that every programmer in a large organization will want to
use the same computer language seems fanciful. IBM tried, in the late 1960s, to
browbeat everyone into using PL/I. It was more widely adopted than Java but
never crushed Fortran and Cobol like it was supposed to. Today, 20+ years after
PL/I's peak, it is tough to find anyone who even remembers the language.
Why won't everyone want to program in Java? The novices will want scripting
languages and declarative languages. The experts will want to program with
features from modern computer languages (Eiffel, Lisp, ML). The speed freaks
and hardware nerds will want languages like C. The Microsoft tools (IIS, Active
Server Pages, .NET runtime) aren't tied to any particular computer language and
recognize that an organization will have a diversity of programmers and
therefore a diversity of programming languages.
[All of this ignores the fact that Sun greatly hastened the demise of the Java
language by picking a fight with Microsoft (Sun's 1997 lawsuit, for example).
They're now in the position of saying "Java is the world standard computer
language except that you can't really use it to develop an application for
computers running Microsoft Windows, i.e., for 85 percent of the world's
computers."]
A theoretical discussion about programming tools can be entertaining for a few
minutes. But here we are in the 8th year of Java and it should be easy to judge
the tool by results. Where are the great sites that have been built with Java?
On time and under budget? You see a lot of nice Perl sites, e.g., Slashdot. You
see a lot of nice VB/ASP sites, e.g., Netflix. You see some weird things, such
as Amazon (C plus proprietary scripting language) and Orbitz (Common Lisp back
end; see http://www.paulgraham.com/paulgraham/carl.html). Even Sun's marketing
staff can't come up with anything interesting built with Java: see
http://java.sun.com/products/jsp/success.html and
http://java.sun.com/products/servlet/success.html .
Oh well, that came out sort of long and negative. I guess I should close on a
positive note. From a brief scan of their marketing PowerPoints, it looks as
though the Java/J2EE folks have realized that interfacing to other languages
will be necessary. They want everyone to learn and use CORBA! That should
provide us all with many years of entertainment.
-- Philip Greenspun, April 20, 2002
Philip,
I think you are throwing out the baby with the bathwater. Many companies use
J2EE but don't use EJB persistence. EJB persistence isn't the solution to
everything in the Java world. It makes sense when you have a piece of
functionality that you would like to package and sell to many customers or
developers without dictating their choice of database. MIT would not need that,
and they could create SQL manually and either create a data access layer or
just embed the SQL directly into the JSP. So the performance would be
comparable to .NET.
Java allows you to have many options in building an application. You have
choices for operating system, development environments, databases, web servers,
servlet engines, and full-blown J2EE Applicaton Servers. It's possible to
choose a set of these that performs badly as you described, or efficiently like
the original ACS. Using .NET limits the choices considerably.
Java also has excellent security. .NET supports multiple languages and allows
developers to make mistakes that are not possible with Java. You can run Java
applications with open source Apache and Tomcat, which have a better track
record for security than Microsoft.
In the long run, the competition (both closed and open source) in the Java arena
will lead to better products than Microsoft will be able to offer.
-- Ben Ballard, April 16, 2002
As an example of a nice Perl site, Philip gives Slashdot. This is a
rather arguable example, though I personally like it, many people don't.
As the local mod_perl zealot, I'd point out http://www.imdb.com/ as the
ultimate Perl site.
I also agree that Java/J2EE going to CORBA should provide us with plenty of
entertainment.
-- Pierre Phaneuf, April 20, 2002
Philip,
I see your point, and I think there is a lot of sense in it. My company's
product is written with Java, and since working here I have become most
proficient in that language. Aside from my own preferences, I have a lot of
respect for Bill Joy, James Gosling, and the other folks who created Java, and
from what I understand, they solved a lot of the problems of C and C++ with the
Java language. For many companies, the lower performance is worth it to have
more reliable software that was developed in less time. Also one of these days
they may fulfill the original purpose of Oak, the predecessor to Java, and
there will be many little embedded devices that people will be able to develop
software for in Java.
That being said, I'm not crazy for J2EE, and would prefer to create 2-tier or
1-tier applications around Oracle. I like to write my own SQL, and keep the
interface simple. I want both speed and reliability.
Sun has made some serious mistakes. In addition to starting an unproductive war
with Microsoft, they've pissed off a lot of their best users by not giving it
away as open-source, and not cooperating fully with groups like Apache Jakarta.
It will be interesting to see what happens in the next few years. I wouldn't
mind if .NET and Java become acceptable options that can interoperate.
-- Ben Ballard, April 23, 2002
In my opinion, Microsoft programming tools are a lot like fast food on
a road trip. You are in a rush and it is easy to pick up and you seem to
initially save time. Near the end you feel bloated and sick(that not to say
proprietary solutions from Sun are _that_ much better). I hope that Microsoft
is unable to destroy the World Wide Web via its .NET initiative. .NET is simply
a proprietary client server application that wraps around web standards (xml,
html, soap etc).
I wrote a
little rant on what I think about IE only sites.
Anthony
-- Anthony Barker, July 10, 2002
Philip mentioned in his response that half the class chooses ASP.NET
and the other half chooses JSPs. I wonder what the percentage is that choose
alternatives like Perl, Python, PHP, Tcl, etc. However, in the Internet
Application Workbook Philip suggested not to dismiss these scripting languages.
I wonder what percentage of the course chooses such an alternative route and
why they tend to shy away from it so much. Are there any overwhelming reasons?
-- Kendrick Hang, September 15, 2003
choosing asp.net has many advantages some of them I describe here. In
asp.net we can reduce the code. Asp.net -ide has importent tools for creating
server side controls and easy for validation control. Developer don't need to
learn so difficult coding as in J2EE. Asp.net support event-driven programming
in which developer can easy understand and debug the coding in less time. One
thing of using asp.net is that asp.net is not so case-sensitive as java. But
there is one major disadvantage of using asp.net is that asp.net tied you up in
Micrisoft Environment.
-- jitendra kumar prajapati, March 10, 2004
I've had the opportunity to develop applications in both .NET and J2EE.
The main advantage I observed about .NET was that a shorter development time
could be accomplished. For example:
With EJBs, if any change were made to a class file or EJB in particular, it
would require that the entire application be repackaged and redeployed. With
some application servers, you are able to skip the step of repacking by working
in an exploded environment, but redeployment or restarting the app server was
always necessary. At least this was the case with JBOSS, WebLogic and Oracle
9iAS. Depending on hardware the entire process can take up to 3 minutes.
Considering that 1 line of code change will cost you 3 minutes to deploy, it
all adds up to much wasted time.
Another advantage of ASP.NET to J2EE is that everything is tightly knit. With
J2EE, the benefit of being able to pick and choose your components comes with a
cost. I would not be surprised if students were unable to setup the J2EE
environment in 2 weeks. We had oracle consultants come in for 2 days and leave
with no clue of why the environment was so unstable. Application servers are
often tested with outdated specifications. Very few application servers are
ready to support the latest technologies that IT managers and developers want
to use. It is true that MS does not offer the flexibility that J2EE offers. But
at the same time it lends it self to fewer headaches.
Performance is another advantage of the .NET platform.
The biggest advantage I see in J2EE is cost. Because of its nature, and the
fact that we are able to pick and choose, we are able to pick the environment
we see fit. It is possible to develop a full blown J2EE application without
ever spending a penny on application server software, operating systems, and
databases. Open source does come with its costs in terms of “no support or
service”. But very often, you will find that the open source community can help
you resolve most if not all the issues you may run into. IÂ’m not going to argue
for or against open source as it would be out of the scope of this thread.
J2EE is not susceptible, or at least not as, to vendor lock-in. It was
mentioned that only 1% of code needs to be changed, but that 1% is not always
obvious. Although IÂ’ve never actually ported an application to one vendorÂ’s
server to another, we did come very close. We sat down and evaluated what would
be involved, and found that no code changes were necessary. The only files that
needed to be altered were 2 xml files. The ability to move an application from
a $100k server to an open source server is a huge deal.
In conclusion, I canÂ’t argue that one platform dominates the other. I think the
two technologies cater to different but similiar group of consumers. They
should be able to co-exist for quite some time. For purposes of marketing
yourself in your career, IÂ’d say that it doesnÂ’t hurt to know both. Using
either of these technologies in a project will require careful evaluation,
-- Vincent Wong, March 12, 2004
|