I posted a week or so ago about my solidifying realization that Java is no longer (if it ever was) one of the better languages for building web-apps.
The original article, Why Are There So Many Java Web Frameworks? can be found here.
One of the points made in that article was that as you mix different frameworks into an application you end up having to tweak or work around attributes of each framework that aren’t compatible with, or are undermined by features of another app.
A really good example of this, and the one that impacts me the most right now is probably how Spring and the hot-deploy capabilities of Tomcat interact.
When Tomcat reloads a class after the source file is changed, it dumps/clears the web context and reloads or rebuilds it. This is typical for the various application servers I’ve worked with (including Jetty, WebLogic and others). When Spring is being used, the context dump also dumps the Spring context, meaning that all of the beans that Spring manages need to be reloaded. Yuck!
Spring does have a refresh method which may avert some of the greediness of this process. I’ve never been able to implement it though because I don’t usually have control over the dispatcher servlet because I’m using Struts! This is yet another example of how frameworks compound application complexity when used together.
The net result for me is this. On an application with 3164 classes and 405 beans managed by Spring it takes me 63 seconds for the hot-deploy mechanism to pick up my changes.
So, in Java:
Ugh!
In any interpreted language:
Here’s what’s great about Java.
If you read almost any Java blog or talk to any junior to mid-level Java developer they’ll cite those two attributes as reasons why Java is so wonderful. There may be other reasons in addition. But you’re almost guaranteed to hear those two. Oh, you may also hear “It’s so much better than C++”. Who’s writes web apps in C++ though?
Unfortunately however, that’s not the whole story. If you start asking around, talking to Java developers with more experience, and particularly those who’ve worked in other language environments, particularly using interpreted languages, you’ll start to fill in more of the picture.
I could go on. But you get the point.
Live and let live I say. If you’re happy with your development life-cycle, the speed at which you develop applications and the tools available to make you more productive I’m truly happy for you. I would, however encourage you to look further afield. Try using some different languages. Try NOT using frameworks and just deal with the problems that the Java fundamentals (things like Servlets and JDBC as opposed to component-based UIs based on markup and ORM (object relational modeling) tools. You’ll be surprised how much faster your applications are. Whatever you think you’ll gain most likely won’t be worth the complexity and learning curve to attain it.
And lastly, if you’re a framework developer, keep it up! There may be a killer app out there that will boost Java past the yuckiness I’ve described. And you may be just the right guy to discover and/or develop it.
Just as a final clarification, lest you think that I’m a Java hater, I’m not saying that Java is bad. I’m just saying that it’s not the best tool, or even the best starting point for building applications for the web.
I feel that a lot of businesses have felt the need to embrace “enterprisey” platforms. At the same time, they’ve felt the need to embrace an increasingly web-based delivery model and Java has catered to that crowd. Businesses have embraced Java mostly because there weren’t any better alternatives, and or they didn’t have enough experience and knowledge about Java to be discerning or find alternatives. That is to say that there weren’t other platforms that catered to the crowd interested in “enterprise-scale web applications” to the degree that Java and Sun did. So Java was a safe choice for managers and developers starting out and looking for a technology to use as the basis for their career.
My thoughts in this article are intended to encourage IT managers and developers to look outside of the vast confines (isn’t that an oxy-moron?) of the Java landscape and consider options and alternatives for enterprise-scale computing platforms. It’s become simpler and simpler to achieve scalability (one of the biggest demands from the “enterprise” crowd) since Java became King of the Enterprise. And I think it’s time for businesses, particularly IT managers and senior/lead/principal developers and engineers to build on a platform of simpler, more nimble technologies to meet ever increasing demands for agility in the marketplace.
Every day it seems I read an announcement of the release of a new Java framework, or an upgrade release for an older framework.
Three facts should tip you off to a problem with using Java for web projects:
The third point causes the most concern. If every framework needs yet another framework to make it complete, then you’re never going to end up with a complete solution. You’re going to be passing the buck endlessly, and forever looking for a solution to your immediate problem.
Next question is, why are there so many of them? Surely if someone could build the perfect Java framework for building web-apps someone would have over the last ten years.
This leads me to think that:
“You can only put so much lipstick on a pig.”
Java is just the wrong tool for building web-apps. Scripting languages are far superior. The main reason for this is the statically compiled nature of Java. Interpreted languages will give you a much faster and continuous development cycle.
I welcome your comments on this topic. If you think I’m wrong, show me how and why. In particular, tell me what combinations of frameworks work best for you.