Adam Bien's Weblog

Thursday Sep 10, 2009

Java EE or .NET - An Almost Unbiased Opinion

Arguments pro Java EE:

  1. Java EE has better OR-support than .NET. JPA, Hibernate etc. .NET comes with Entity Framework, but it isn't as lean as JPA. In .NET land there are some ports from Java available like e.g. NHibernate. .NET seems to more rely on stored procedures, whereby in Java we prefer (sometimes are obsessed) to keep everything in domain objects outside the DB.
  2. Build systems and CI tools in Java are more advanced. Hudson + Maven / ANT is a really nice and lean solution. On .Net side you can use NAnt or a proprietary MS tool.
  3. Community: Java community rocks - in .NET you have to rely on MSDN. However - this can be considered as advantage and disadvantage as well. You will (always) find an answer for your question for free.
  4. Java is the most popular language #1.
  5. Java IDEs: If you are thinking about .NET vs. Java EE you have already allocated some budget for tooling (otherwise the choice would be obvious). In that case you should look at IntelliJ first. It is the best, commercial IDE. If you are looking for free IDEs, start with NetBeans (best out-of-the-box experience) and Eclipse (the most popular one). Java tool ecosystem is remarkable. 
  6. Integration: Java integration story is excellent. You get connectors for SAP, AS400, files etc. for free. ESBs, LDAP servers are free.
  7. Framework / Libraries: If you need a specific library - you will find everything in Java. Before you are going to write a single line of code you should do some research first.
  8. Strategic consideration: with Java EE you are truly vendor-neutral. This is very handy in the price-negotiation phase. You can even go into production without any costs (subscriptions, licenses etc). Java EE apps are very portable. Java EE is not even dependent on Sun - it was developed by all major vendors.
  9. Stability: Java language is stable for ages. There are no breaking changes. Java EE 5 and 6 platform is backward compatible as well. So you can deploy your legacy J2EE 1.X app to a Java EE environment and smooth-migrate it (if you like to).
  10. Best practices: Java EE / J2EE are about 10 years on the market. There are many applications out there. The most mistakes are already made - the best practices / patterns are very mature.
  11. In most of the .NET projects you will find opensource extensions, as well as, commercial .NET tools. Such a mixture can be very "interesting" (regarding support issues)
  12. Operating System: you can choose whatever operating system you want to for production and development.
  13. Opensource: 80% of Java applications in production are built on opensource tools. This is your ultimate insurance.

Pro .NET:

  1. You get everything from one vendor.
  2. C# develops very fast. It has nicer features, than Java. C# shines in the DSL area. LINQ is very nice for database (and tree-like) queries (however you should look at Scala and Groovy if you need similar features).
  3. You don't have to search for a given solution. The choice is clear. It can save you a considerable amount of time.
  4. You will find most of the tools at MSDN - there is no need to evaluate tools and IDEs in advance.
  5. Visual Studio .NET is a very good environment with very good DB and team extensions. With a commercial plugin (like e.g. Resharper), it gets a good, as IntelliJ.
  6. The UI best practices are more consistent, than in Java. ASP.NET MVC is e.g. the way to go in .NET. In Java EE you will have to choose between JSF, Wicket, GWT, Struts 2....
  7. The language integration in .NET is seamless. You can easily call methods from C# to VB.NET. In Java it is hard to call Scala functions from Groovy.
  8. SharePoint, Exchange and Office Products are very well integrated with .NET. You can access them with Java, but will need third-party libraries.
  9. Continuous Integration comes already with Visual Studio Team System.
I forgot some arguments for sure - what is your opinion?


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Kommentare:

Pro Java: Frameworks from large companies like the Webdynpro Framework from SAP (and the whole SAP SOA Solution) or the Webtop and DFC Solution from EMC Documentum are based on Java EE. As a Java developer you can learn such frameworks really fast an integrate them well with other (open source) libraries like reporting tools (Jasper reports)

Gesendet von Jens am September 10, 2009 at 10:48 AM CEST #

Nice post! I just wandering whether it will trigger 'religious' discussions :)

Anways, I would split the #2 item in pro .net in several liners - makes it easier to read.

Gesendet von Siarhei am September 10, 2009 at 10:58 AM CEST #

Hi Adam

I find that the biggest stumbling block in the Java EE vs .Net debate is that Java is seen as being slow, and not having the performance to be able to cope with large enterprise applications.

It is very difficult to move forward in discussions when this is constantly brought up.

I suppose the simple question is this - Is Java EE slower than .Net?

Having asked the question, I'm pretty sure there isn't a simple answer, but i would like to hear opinions & thoughts on the matter

Gesendet von Tim am September 10, 2009 at 11:57 AM CEST #

Tim,

Java is faster, than C# - I will try to find some links again.

It doesn't matter whether Java EE is going to be slower or faster than .NET.

In all of my past projects the problem was not the platform, rather than the application design. A single bottleneck or DB-lock can take down the performance of the whole application.

E.g. the overhead of transactionality, security etc. in EJB 3 is only few millis: http://www.adam-bien.com/roller/abien/entry/is_it_worth_using_pojos And this doesn't matter in the practice.

thanks!,

adam

Gesendet von Adam Bien am September 10, 2009 at 12:25 PM CEST #

Thanks Adam,

The links and just this blog alone will be very helpful

Gesendet von Tim am September 10, 2009 at 02:07 PM CEST #

@Tim some low level java vs. c benchmarks (via azul systems blog):
http://blogs.azulsystems.com/cliff/2009/09/java-vs-c-performance-again.html

Gesendet von michael bien am September 10, 2009 at 03:04 PM CEST #

Great comparison Adam!
Having developed in both, I really agree with the number of frameworks/solutions in JEE vs. limited selection/straight forward .NET. I find as a consultant getting started in a new client's Java stack can be a challenge, where I basically know what I'm getting on a .NET project. However, later on in the project when we're running into complex issues on the .NET project I find myself "wistfully" looking at all the Java Community solutions I could've used.

Gesendet von Wes am September 10, 2009 at 04:02 PM CEST #

I pretty much agree with Adam in that when I do .Net, I end up hogtied because I can never stay in the Microsoft predefined happy path. In the long run it doesn't save time.

Some other notes. VS.Net, even with addins - is not as good as Eclipse, let alone IntelliJ. ASP.Net MVC is still in infancy and even when mature is not the "way to go" for all things. You also don't get everything from Microsoft. Otherwise there would not be such a large third party market. I hardly find anything in MSDN.

Gesendet von Mark am September 11, 2009 at 02:56 AM CEST #

Both platforms are comparable but the only problems is of standards.

If stick with something that is built on standard and there are competitors working on those standards and then everybody is kept in check.

If you invest in .NET and tomorrow MS got a fancy idea, it won't give a damn about your investment and implement it just to look it nice against Java.

There're broader things to think about than some language esoteric being introduced in C# everyday.

Gesendet von ranjan am September 11, 2009 at 07:04 AM CEST #

Pro Java: In .Net the unit of dynamic loading is the .DLL - need upfront decision to get them right. In Java Every class can be dynamically loaded - no foresight is needed

Gesendet von Itay Maman am September 11, 2009 at 07:56 PM CEST #

Pro Java: EMF and the tight integration of MDSD/MDA concepts in Eclipse.

Pro .Net: If you are interested in game development, then you should stick with XNA. That was the way I got in touch with C# :-)

Gesendet von Thomas am September 11, 2009 at 11:44 PM CEST #

You get everything from one vendor.

It's more like you are tied-up to one vendor and whatever it decides how much you should pay or if you should continue breathing.

Compare Java and Mono development.

Gesendet von Mustang am September 13, 2009 at 12:50 AM CEST #

You don't have to search for a given solution. The choice is clear. It can save you a considerable amount of time.

That is not exactly a plus either. In Java there's a lot of choice, sometimes too much I know but you can chose to use a tightly integrated package from BEA or a consolidated stack like Grails. You are most likely to still be able to remove a component and replace with some other that fits your needs better and still is widely used and supported.

Gesendet von X am September 13, 2009 at 12:55 AM CEST #

Adam, Is the "almost unbiased" subject intended to be taken seriously? Seems definitely skewed in favor of java.

To clarify, I'm not saying one is better than the other. But it definitely feels like you don't have much .NET experience. I've got about 4 years development experience in each, and I still don't feel I'm up to the task of providing an unbiased opinion.

Gesendet von turtlewax am September 15, 2009 at 05:43 PM CEST #

Turtlewax,

I'm working with Java since 1.0 days in projects, and evaluating .net periodically. I have much more experience with Java, than .net. However, I built already several .net apps as well.

But if you see some .NET advantages over Java I didn't listed - just drop a comment!,

thanks!,

adam

Gesendet von Adam Bien am September 19, 2009 at 01:05 PM CEST #

A welcome discussion, gentlemen. A question: I have been chartered in making a decision for my company. We need a web based application. Options:

1. To select an integrated application that was built and serviced over 25 years by a company comfortable in its position in the market. Built on a windows platform, built specific to my industry, but now they have "transformed" that application to an "online product" they swear is .net platform, not thin client referring to it as "browser based". It is a global application, having much history of client usage, however the web application is fairly new, probably developed with same influence and team as coded the windows based application? Customization would be costly, hardly any freedom to customize the application without penalty, long waits.

2. A java application, built from scratch for web deployment, more general with direct access to the programming team/project managers. The application features 1 time setup to wrap it around our business, with a healtht tool-set. Highly compotent team, impressive end-to-end application, satisfies 80% of our needs, the other 20% would be customized with minimal investment.

Suggestions?

Gesendet von Adumbrate am October 02, 2009 at 02:53 PM CEST #

I have feet in both worlds. I think dotnet's is both advantaged and disadvantaged being basically a single vendor solution -- and a costly one at that. The cost to entry for dotnet based projects can be staggering and this is assuming of course that the development toolset and servers are licensed and hence paid for. I also find Microsoft overly complex and bloated. Your ORM example serves pefectly to highlight this.

Visual Studio is the only real solution for dotnet development and as such has to be the best ide just by default. Yes there are ides for MONO but I don't consider them viable yet. Visual Studio's tooling features (code generators) are excellent and this is a good thing because they hide the complexity of the technology you are trying to implement -- take strongly typed datasets (which I use a lot) and their associated xsd and class files. I'd never use them if I had
to code all that by hand.

The biggest disadvantage for java based solutions is the quality of documentation if you are lucky enough to find any. I find the gramatical errors in much of the documentation renders them close to useless. It is a shame that on many opensource projects documentation and localization of documentation is nothing more than an after thought at best.

But honestly, I love Java and I think it is a much cleaner and leaner solution for any application/system that does not need to integrate with any proprietary Microsoft server based technology. Given the choice, I'd go with Java in these situations. Also, I consider Wicket to be the best web framework I have ever seen and being a java based framework just endears it even more to me. It is perhaps the greatest thing since sliced bread lol.

I don't agree about IntelliJ though. I keep trying the new versions when they are released but so far I don't see any benefit it has over Netbeans which I consider the number 1 Java development ide available today. The things I do in Netbeans like EE apps seem overly complex to wire up using IntelliJ. Perhaps I just don't know IntelliJ well enough to know that I don't know how to use it and configure it properly. Netbeans in my opinion just rocks right out of the box so to speak. And the fact that it is free is the icing on the cake though (shhhhh - don't tell anyone I said this, please lol) I would even pay to use it.

Thank you for your many interesting articles. I enjoy reading them and following along with you on your numerous projects.

Sincerely, Jeff
http://jeff-schwartz.blogspot.com/

Gesendet von Jeff Schwartz am October 02, 2009 at 03:24 PM CEST #

Adumbrate,

Anytime you have the ear of the development team it is a far superior experience for a company. Apples to apples, in your situation, it is not a matter of java vs .net, but instead, which team will hear your requirements and develop quality work based on your needs. Generally speaking, because business climates change, customization flexibility would be a better choice, long-term. You don't want to be back in this position to choose another application in a couple years because system restrictions force you to make another selection to achieve objectives.

Good Luck.

Gesendet von GoogleMan am October 02, 2009 at 04:55 PM CEST #

In Java field, we even do not need to spend a cent in development tools, all free but excellent: Netbeans, Eclipse, Tomcat, Mysql, Linux Fedora..All those sweet tools made me happy in my past several years.

Agree with Mark, In the long run it doesn't save time when choosing .NET. When we're working on some big website(or ecommerce platform), we're pretty sure the site will be live very long(perhaps 5 ~ 10 years or even more?).. The open source community will keep open and free, however what will Microsoft do 5 years later? Once they changing their policy in using Visual Studio or MS SQL Server, we will be really hurted.

Java's write once, deploy everywhere principle and its open source communities - that makes us really happy life and yes, vendor independent... I would not get any problem if Sun was merged by Oracle - they both are Java Vendors, however I rely on free java communities.... thinking only if MS will merge Sun, however apparently MS has built a drunk MicrosoftJ in past several years and now it's in MS's recycle box.

Also, Java's deployment in Unix/Linux servers has made me lots fun. Linux deployment is really fast, and its remote control is far so easier than Windows systems. All my projects are now running on many linux servers. They are all stable - and run fast, and can be easily managed remotely. this is where my happy life comes.

I will continue my happy life with Java/J2EE/Linux, will u?

Gesendet von John am October 04, 2009 at 11:43 AM CEST #

Adam,

I think that you miss the point stating that JavaEE has better ORM support than .NET.

While, probably, being true, the statement completely ignores the fact that .NET is much more open towards the database community than JavaEE is. With LINQ (which, by the way, is way more elegant than this ugly new fully typed JPQL API) Microsoft is open towards various kinds of data sources (not only relational ones).

I'm afraid that, in this particular case, it is Microsoft that is open (and Oracle that is closed). Not surprisingly: Oracle is an important (rather conservative) player in the relational database world.

If Java continues to position itself on the conservative side of the road, it is going to loose more and more fans.

Luc

Gesendet von Luc Duponcheel am October 12, 2009 at 10:01 AM CEST #

Luc,

but: LINQ is actually only usable with SQL database behind it. It is possible to query data structures and XML - but this are only rare cases (did you used that feature in projects?).

Btw. I wouldn't classify LINQ as ORM, rather than an object oriented query facility.

I'm glad, that you agree on all other points :-).

.net world tries to copy Java sometimes - nhibernate is very popular. However, it isn't as mature, as the hibernate.org original.

thanks for your opinion!,

adam

Gesendet von Adam Bien am October 12, 2009 at 10:11 AM CEST #

A stong point on .NET is the client side application part. In JNI you mostly need a C++ compiler to create a bridge and a Java part bridge. Most of the cases either C++.NET or C# (for C based APIs) can handle without two languages bridge.
If the application is not exposed in a browser makes much easier to get the knowhow of the desktop application and to reuse it to add a server side functionality.
From my experience the JIT of .NET is not so "adaptive" as Java does, so may lose some performance on server side, but in most cases it gives "just enough". Based on this, I think that on a long run,

Gesendet von Ciprian Mustiata am October 12, 2009 at 11:35 AM CEST #

There's a lot of good information here for anyone considering coding something in Java or .NET.

Considering the ease of coding in ASP.net and the fact that it's at least as fast as Java, I personally could not see using java for anything web based these days....

Also I would like to point out two things:

I strongly disagree Java is more stable. I constantly have hello world apps crash, java updaters crash and this is more than one computer simply because the Java platform is buggy.

Also, I do think there are more IDEs available to Java but I cannot even count Eclipse as one of them. It would be a decent editor but it likes to freeze up for lengthy periods of time, and crash a lot.

Gesendet von Dean am February 14, 2010 at 11:10 AM CET #

Asking which is better Java or .Net is not good question, or which one is open source is again not good question, but asking which one makes the life easier for the mainstream developer is the question, also beside this another one might be which binary is more optimum relative to the hardware (this not easy question), now let us look at the easier one, regarding the easy life for the developer, here definitely is .Net and here are the basic simple reasons:
1- Both platforms are composed mainly of classes, but their hierarchies are different, yet two solutions can be implemented in both (here the Microsoft team responsible for the most optimum code to use to build their classes seek help from the kernel writers the management dll (sources only available to them), …etc
2- Both platforms are basically semi-interpretive (Produce opcodes)
3- Now the main difference and big setback for Java is the IDE that is the cooperative and supportive tool for various phases of the development life cycle (do not forget MSDN)
4- The supporting libraries and components written for .Net are much more than the once written for Java
The above 4 points prove without any confusion that .Net platform is easier to use (more productive and less costly per line of code) and also the code produced (for windows only!!!) is more efficient in case of .Net

Gesendet von Najah Talia am February 27, 2010 at 12:45 AM CET #

Senden Sie einen Kommentar:
  • HTML Syntax: Ausgeschaltet
Interviews/About
My Recent Book
Java One 2009
CommunityOne East N.Y.C
JavaONE 2008 Interview
Search
...the last 150 posts
...the last 10 comments
greenfire.dev.java.net
Links
my.netbeans.org
Visitors
License