tags:

views:

8125

answers:

20

We are currently planning to launch a couple of internal web projects in the future. Our company's dev teams are mostly experienced in J2EE and have worked with it for years. Today, we have the choice of launching a couple of our projects on .NET. I have checked out a couple of sources on the .NET, and it seems like the "J2EE vs ASP.NET" combat brings out as much discord as the overseen "Apple vs Microsoft" or "Free Eclipse vs Visual Studio"...

Nevertheless, I have been somewhat quite impressed with ASP.NET's abilities to create great things with huge simplicity (for ex. ASP.NET AJAX's demos). No more tons of XMLS to play with, no more tons of frameworks to configure (we usually use the famous combo struts/spring/hibernate)... It just seemed to me that ASP.NET had some good advantages over J2EE, but then again, I may speak by ignorance.

What I want to know is this : What are the real advantages of using J2EE over ASP.NET? Is there anything that cannot be done in ASP.NET that can be done in J2EE? Once the frameworks are all in place and configured, is it faster to develop apps in J2EE than it is in .NET? Are the applications generally easier to maintain in J2EE than in ASP.NET? Is it worth it for some developers to leave their J2EE knowledge on the side and move on to ASP.NET if it does exactly the same thing?

+14  A: 

I think the two technologies are pretty much on a par.

MVC was better supported with Java, but Microsoft has now released its own implementation for ASP.NET.

I don't think you're quite right with the following: "No more tons of xmls to play with, no more tons of frameworks to configure (we usually use the famous combo struts/spring/hibernate)".

To design a good ASP.NET application you will still need to utilize XML, and there are lots of good frameworks to use - such as Log4Net and nHibernate...

Having these frameworks is a good thing though - not sure why you don't like them.

Many people say ASP.NET has the advantage of allowing people with different language skills to use the same core framework – VB, C#...

However, given that all your colleagues know Java well, I'd have thought that was your best option. Unless everyone wants to learn a new skill!

Personally, I really like Java and .NET and would be happy to use either.

Joe R
+8  A: 

Coming from the .Net side I don't see as much advantages as you do. The frameworks like hibernate and spring are there for a good reason and are being used on the .Net side too (nHibernate and Spring.Net) although they are not being pushed by Microsoft.

The wizard driven way of developing that has been pushed by microsoft for some time has some serious drawbacks. Maintainability is the main one. It's easy to click together simple data driven webpages but as soon as you want to add behaviour to it that isn't supported by the wizards you're better off starting from scratch. The typical wizard generated application has no layered architecture and isn't very flexible.

There are some small advantages. There seems to be better support and documentation on the .Net side, The languages are a bit better developed. Java has been standing still for some time although that seems to be changing. Downsides are less flexibility, don't try running an ASP.Net page on apache. You can (mono) but I wouldn't do this in a production environment. Less frameworks etc. (although this seems to be changing rapidly too)

Mendelt
A: 

I did some J2EE some years ago. My impression was - in J2EE most things are done the right way, but a lot of XML and other manual work as you mention. IDE's are still better for Java. Jetbrains IDEA and Eclips are better the Visual studio, even with Resharper. All the proper ways of doing stuff (transactions, spring, AOP, unit testing, DDD) have longer traditions in Java.

In MS world, you could do stuff quicker. But it is usually also dirty. Many complain about ASP.NET, that it is not proper MVC. They are creating proper MVC, and I don't know how fast it is going to be to work with it. Newest DAO frameworks from Microsoft (Entity framework) still are very database-centric (bad).

In any case, if your developers decide to move from J2EE - they don't have leave their knowledge. They will apply Spring.NET, NHibernate (there is nothing better in .NET either). They will use Resharper for visual studio. They will use NUnit instead of JUnit and stuff like that.

Ask your developers. If they are fed up with coding JSTL manually - let them do ASP.NET, and if they would like to adapt something new, they may benefit for it.

But I see no reason for moving from Java either.

My personal choice - probably .NET (one day I left the job because of JSTL, HTML and XSL, however now I am doing windows client, I like all the new cool stuff Microsoft does) with application of good Java traditions with NHibernate, spring and stuff and remembering good old days with Jetbrains IDEA.

badbadboy
What is with these responses? They're ridiculous. Define "better" in the sense of an IDE. Quick? Sure, you can do things "quicker", but most people realize the short comings of the quick way and don't do it. Many of the same DAO frameworks exist in both the Java and .NET worlds.
senfo
+18  A: 

What are the real advantages of using J2EE over ASP.net? Being free from Microsoft. Yes, some of their stuff is good. However, they make their stuff non-standard, they make random changes to their technology direction, and you have no recourse because you are locked into a single-vendor solution.

Is there anything that cannot be done in ASP.net that can be done in J2EE? Yes. The J2EE things that can't be done in ASP include anything defined by standards. In J2EE, standards compliance means you can fire any vendor and replace them with a better, more responsive vendor.

Once the frameworks are all in place and configured, is it faster to develop apps in J2EE than it is in .net? No.

Are the applications generally easier to maintain in J2EE than in ASP.net? Yes. Microsoft, if past is any indication, may make some incompatible change that will break parts of your application or tools.

Is it worth it for some developpers to leave their J2EE knowledge on the side and move on to ASP.net if it does exactly the same thing? The question has a hidden assumption that I think is unfair. You don't "leave" knowledge. Knowledge is not a zero-sum game, where learning ASP replaces their J2EE knowledge.

In short, if you have J2EE experience, why change? Further, why move from an open, standard architecture with many competing vendors to a closed architecture, where a single vendor so dominates things that their whims become your strategy?

S.Lott
You could use C# with Mono and therefore never touch Microsoft. I think it's worth mentioning.
Joe R
@S.Lott: looks like you're having problem with "not" in this sentence: Is there anything that cannot be done in ASP.net that can be done in J2EE? No. The opposite (J2EE things that can't be done in ASP)
badbadboy
@badbadboy: thanks!
S.Lott
@S.Lott: You are welcome :) PS I think your answer is too subjective (much more than the question).
badbadboy
@badbadboy: Since both platforms are nearly equivalent, the differences are entirely subjective. The only differences I can find are nuances. Your answer seems similar -- nuances only.
S.Lott
@S.Lott: you haven't however mentioned any advantages of .NET, except being locked with Microsoft :)
badbadboy
This response is a load of crap. You speak of "non-standards", but which standards impact development? Also, Microsoft is known for keeping backwards compatibility. I have *never* had an app break because of a new version of the framework.
senfo
I think this answer stands well on it's own--other folks have mentioned plenty of advantages. Vendor lock-in can be a big deal for some development shops: 1/2 way through the program you realize platform X does not support feature Y. At that point, can you easily switch from Windows to Linux, etc?
Ogre Psalm33
If you're concerned with HTML standards, Microsoft has taken significant strides in conforming to standards since .NET 2.0 was released. Furthermore, the ASP.NET MVC framework gives you the flexibility of conforming (or not conforming) to whichever standard you choose.
senfo
@senfo: When you put in non-standard hacks to make IE presentation work, that's cost, complexity and a barrier to portability.
S.Lott
@S.Lott: The same hacks exist regardless of the platform. IE has absolutely nothing to do with the development platform.
senfo
@senfo: True -- IE is a bad example of Microsoft non-standard features on the ASP/.Net server side.
S.Lott
Microsoft will not make changes that will magically break a working application. The only way this could happen is if you choose to upgrade frameworks or tools mid-development/maintenance. This is no different in the Java world. If you upgrade to a newer version of a library, it might have different dependencies, different configuration structure, etc. that could break your application. Your assumption that J2EE is easier to maintain does not make sense.
markt
@markt: "Microsoft will not make changes that will magically break a working application" Sadly, this is far from true. I'm currently trying to find out why our application "magically" stopped working when we the Windows CE SDK version. Microsoft upgrade broke our app.
S.Lott
@S.Lott You mean you moved to a new version of the SDK for development ? If that is what you mean, then breaking changes should not be a surprise. That is to be expected. You can not expect an API to remain exactly the same throughout all versions - this would significantly hinder progress.. Typically in .NET client side updates should not be a problem. Applications continue to run on the runtime version that they were built for.
markt
@markt: I realize that with Microsoft, changing versions of the SDK breaks things. I have not had that experience with Java (or with Python for that matter.) My experience with non-Microsoft products is that I *can* expect things to stay working when I get a new SDK.
S.Lott
As long as Microsoft has not put the "WE WILL USE PATENTS AGAINST MONO-USERS" in the grave, the Mono platform will be at risk.
Thorbjørn Ravn Andersen
@Thorbjørn: Come on! C#/CLR/IL are ECMA/ISO standardized. What patents? There is much more danger that IBM will stir up their 165000 patents (http://tinyurl.com/3xlcvmh http://tinyurl.com/2vemyr9)
abatishchev
@abatishchev: Sadly, I've had more than one customer with a code base that cannot be maintained because Microsoft made a totally incompatible change to a language or library, making their software an orphan.
S.Lott
@S.Lott: I was talking about patents. Against deadly changes to code base nobody is insured. Nevertheless I don't think that's a Microsoft specific policy.. any vendor, small or big, did this, do and will do. http://stackoverflow.com/questions/313894/what-are-the-advantages-of-using-j2ee-over-asp-net/313948#313948
abatishchev
A: 

I don't think the one platform has a clear technological advantage over the other. It is basically a matter of personal preference and previous experience. In general, I find that the existence of many frameworks for Java is a good thing. Also, for enterprise applications and not simple web projects, there is much more information and frameworks available for J2EE than there is for ASP.NET. For example, if you are need to use Enterprise Service Buses, messaging technologies, interact with many third party Web Services, then I think that the J2EE is the way to go.

On the other side, ASP.NET is preferable for front ends. You are right to say that for J2EE you need to set up a lot of tools. For ASP.NET you have everything under Visual Studio.

kgiannakakis
+4  A: 

Avoiding Microsoft lock-in should be one of the factors that infuence your decision. I do not mean this as an insult but your favourable opinion of .net seems to stem from viewing a couple of tech demos. Of course you will be promised a tool which makes it very easy to do your job but that is mostly just PR talk. There WILL be problems and dead ends during the development and if you stick to J2EE, you may already have the know-how to solve them from the past projects.

mike nvck
You say `Microsoft lock-in` like it's a bad thing and `Sun lock-in` is a good one
abatishchev
+1  A: 

I think they are both pretty good functionally wise. In fact they are probably the two best web development frameworks right now (sorry LAMP fans). Java probably fits better with Enterprise development because it is more standard adherent and there is less vendor and platform lock in. But if you don't mind being stuck running Windows (I know about Mono but not sure it is a serious option) then overall I think .NET is better. While not everything that comes out of MS is great (hello Entity Framework) they are coming out with more good stuff at a faster pace than anyone else.

Craig
+8  A: 

J2EE is older and more mature than .NET, which gives it several advantages for a large scale project. .NET is a newer cleaner version of the same thing, which gives it nulerous advantages in smaller scale projects. Interoperability used to be the main thumbs down for .NET, but with todays fashion for SOA message based interfaces (which are well supported in .NET) this has become a non issue.

J2EE is massive and includes several "dead end" technoligies, a large part of the J2EE learning curve, is learning what not to use. For instance EJBs appear to be a core part of the technoligy -- but experienced developers only use them is a very limited set of circumstances ( client and server belong to the same application and run on the same machine!).

Vendor lock-in also applies to J2EE, only the simplest apps are easily portable between Websphere, Weblogic and Jboss.

In my book .NET just inches ahead of J2EE.

James Anderson
+1: good point re: vendor lock-in
RedFilter
A: 

Java is about choice: it runs on any OS, there is a huge ecosystem of frameworks, IDEs, tools and there are multiple vendors with app servers, support, etc. Microsoft on the other hand is very monolithic: one OS, one set of tools, and generally one programming model to solve each problem.

In terms of technical differences, I would make the following two points:

  1. I think there is a lot more innovation in the Java space. ORM is a standard in Java but it is still struggling to catch on in the .NET universe. The same is true of DI and AOP. The open source movement in .NET is very weak compared to Java, so if it doesn't come from MS then you'll have a tough time finding support for the frameworks or even developers who are skilled with them.

  2. If you believe that rich UX and RIA are important, MS seems to be making a much bigger push with Silverlight and WPF. JavaFX is new but a lot of people are still uncertain about it; in fact many apps with Java backends are using Adobe's Flex/AIR for the UI instead. The nice thing about any of these UI technologies is that you can hook them up to pretty much any backend but being able to share code between client and server is a big key. If JavaFX doesn't catch on then MS will have an edge with integration between SL/WPF and the .NET server.

cliff.meyers
+1  A: 

As i see this the question is not about ASP.NET vs JEE but .NET platforms vs the whole Java platform. If we are in the MS vs Java world war (Which is today same as say - Open Source vs Closed Source war) you should remember one thing: MS has money to invest into the .NET platform, it's being constantly improved and maintained, on the other hand Sun is in economical trouble. If we look at the most basic thing which is the language itself we can see the c# 3.0 language to be much more feature rich and thoughtfully thought about then JSE6, we can see this in all advanced language features such as Generics, Annotations etc.. The important this is that Java now is Open Sourced and becoming community driven platform. If we (the community) will not invest in it, .NET will be much more advanced platform soon enough. So to your question, if this is a small project that you are creating and your developers have the strong background in EE then you should stick to it, but in my opinion Todays .NET platform is a better choice for long term projects. Sure you must see other architectural aspects and functional need, for example if you need platform independence, the choice of .NET would not make a scene, but i'm talking in a more general matter.

Alon
A: 

Reading through the answers I can't really find this opinion voiced so I'll make it a fullblown answer: the only way to know for sure is to try it out on a single small to midsize project and see what comes out of it.

In general, I don't think there's too much difference between the frameworks and any choice between them is bound to turn out to be mostly subjective and driven by what your developers are comfortable with. So really, just try it and see what happens.

wds
A: 

Ruby on Rails , Groovy on Grails and might be Scala

Abu
A: 

.NET beats java on good/FAST IDE as well as simple and fast IIS server(no apache + tomcat) So in short ROI is lot better in .net.

However that being said .net does not work on Unix - and there is no way any smart bank/govt company will run on .NET as its WAY TOO EASY to get virus/spyware on windows system. (which fool will keep on updating paches on "super tuesday").

Hence its comparing apple to oranges. Even though .NET is better then java for the same reason that java beat C++. However with one big difference .NET does not work on Unix(end game).

zel
@zel: Um, Mono? http://www.mono-project.com/Main_Page - "An open source, cross-platform, implementation of C# and the CLR that is binary compatible with Microsoft.NET."
RedFilter
A: 

Although this is a fairly old topic which was kicked up by someone else, I just wanted to add my $2 cents.

On paper, the ASP.NET's competitor is JSP/EL. The ASP.NET MVC's competitor is JSF. The ASP.NET MVC Master Pages' competitor is Facelets. All are included in the currently fresh new Java EE 6 API. JSF has growed to fullworthy competition in years, as does the Netbeans IDE as being the Sun's answer on Visual Studio and Glassfish on IIS.

However, it's still Apples and Oranges. In ASP world you don't have much choice about 3rd party frameworks/libraries or even platforms. That is exactly what makes Java EE extremely strong (although some generalists may find that it makes Java EE opaque). Again, Apples and Oranges :)

BalusC
ASP.Net's competitor are the other 100+ web frameworks out there in Java, not just JSP/EL. MVC has no competitor, it's a design pattern - there's also MVP and a whole host of other options for separating presentation/business logic concerns.
Jon
I was more talking in perspective of Microsoft <--> Sun. Further you maybe missed that I even explicitly mentioned about 3rd party frameworks/libraries a bit further in the answer.
BalusC
+2  A: 

I'm confused why you're limiting your choices to J2EE and ASP.net for internal web applications, correct me if I've misread this. I think Ruby on Rails, Django and a whole host of other "lightweight" web frameworks are a better choice for internal applications simply because they're faster to develop.

J2EE is a big investment and there's a lot of scaffolding (supporting frameworks) that you have to get in place beforehand. After using it for the last 8 years I can't say it's fantastically quick to develop solutions. It's great for developing enterprise scale web applications, but that's a different ballgame alltogether - same principles, different concerns. You'll find ASP.net more restrictive that J2EE in terms of ways to do things, Microsoft generally prescribe a specific way to do things. With Java there are a bloody lot of ways to do something, logging for example (log4j, logback, commons logging, JULI garghhh).

By the way struts/spring/hibernate is not J2EE per-se it's more anti-J2EE and it brings a lot of additional concerns - at least J2EE provides a set of technologies to work with. I've no idea why people advocate Java because it supports MVC better, it's not a framework it's a design pattern. ASP .net MVC exists as well.

http://www.asp.net/mvc/

Your one benefit of using J2EE is that your developers already know Java, but seriously it shouldn't be too hard to pick up something like Django, it might actually be refreshing and way easier to develop internal applications with.

Jon
A: 

I honestly can't see why anybody would use Java given it's inferior in performance, and slower to develop and harder to maintain than just about anything else out there other than third-party plugins that you may require. Maybe some Java developers still prefer Java, and that's cool if they do -- I hope it sticks around for these guys, but personally the reasons to use Java are rather small.

ASP.Net vs Ruby on Rails is a much better argument, and it completely comes down to personal preferences other than volumne requirements (ASP.Net is compiled) because you can do the same thing in either one of them in a similar amount of time, it's just how you get there that's different.

Dean
I see this is being flagged as 'offensive', however I think such groundless provocation not providing a single hard fact doesn't deserve even a downvote. Just ignore it.
Nikita Rybak
+1  A: 

In my opinion, Java's plethora of 3'rd party IDEs & system configurations is also it's downside. Microsoft has put all of it's effort creating one IDE that works amazingly well with it's 1 platform. That platform can do 99.9% of anything you need it to do, when developed by capable people.

Most of these comments about .NET being for quick & dirty development is a reflection of the developers using it, not the framework itself. Real developers aren't using wizards and drag & drop IDE functionality. But that's fine because Visual Studio's legitimate features are great, and make developing and maintaining easy & manageable. The .NET framework itself gives you tons of power and built in functionality, but is extensible so that smart developers can fill any voids that they find.

And the unfortunate truth for the open source crowd is that the downside of 'vendor lock-in' on .NET is over exaggerated. With a well written .NET application, you could swap out a SQL Server back end for oracle, db2, mysql, postgre, in a matter of days or weeks. Yes you need to host the applications on Windows Server 2003/2008, but their speed, reliability, and TCO now meets or exceeds *nix.

To wrap it up, if you're looking at your project TCO, quality .NET developers are plentiful and economical, as are SQL Server DBA's & Windows Server admins. Also, .NET is straightforward to build in, and experienced developers will be able to reliably estimate and deliver applications.

As other people have said though, if your shop is already a Java shop, I would stick with what works. But if you do / did switch, I hope you're willing to bring in outside help that can get you up to speed on .NET.

Tom Halladay
A: 

I have no experience with Java, but I have a strong preference for working in industries where customers are used to paying for intellectual property. Because I too would like to be paid for my intellectual property. So I side with Microsoft.

gkochanowsky
This makes no sense at all. Do you believe people working with Java or C or Ruby or any other language are not being paid for their intellectual property?
EricSchaefer
A: 

MS.net has huge advantage when it comes to quick and rich web apps, because they've already figured out all the dhtl, ajax and db logic. The downsides are the expense of the Visual Studio and Windows licenses, which are recurring expenses forever due to upgrades. And the limitation that it only runs on Windows. Its quite expensive over the long run, but if you are a big, MS shop, it makes sense.

Java has an advantage in that its free, will run on any platform, and the talent pool is large. But building rich UI web apps requires some expertise. The recent publishing of the YUI and DOJO libraries have made this a little easier, but as of today its still not trivial. Visual Studio provides AJAX and DHTML controls as drag and drop.

In my opinion the key to the puzzle is in the DB. Now that DBs stored procs can take XML docs as input arguments, its preferable to put the business logic in the DB. The front end should validate the input with JavaScript, then post the data to a lightweight messaging layer that converts the form post to XML and calls the Stored Proc.

Doug Pinkston
A: 

You've been givien the often rare opportunity to use two competing kinds of platforms in your corporate environment. For that reason alone I say go for it: compare and make your own notes along the way.

John K