domingo, 31 de agosto de 2008

A rant on Java standards

So, I like a Java as a language and I like the whole Virtual Machine thingy. I even dare to say that I like building web apps in Java! Now, everything has limits and JEE sometimes pushes mines just a bit too far.

The thing is Java is growing too much in too many areas. Many people have already started to complain about the number of features (and idioms) in the language itself, probably because Java 7 will bring in some more. I have to say that I was not joining that bandwagon (and I still wait with eagerness the closures support) but I've spent my last three months fighting (there's no better word!) some Enterpise Edition specifications and I'm fed up.

Just take a look at the Java Community Process to get an idea of what is Java today. To me the problem is not the number of technologies or the number of specifications. Nor the fact that Java tries to compete in every possible market niche. I don't mind. The problem is the integration between them! Specially when you group them together and call it a platform.

How can something like JSF be promoted to be the standard? A component framework that lacks even one interesting component! That relies on third party libraries (many OSS) that are, of course, incompatible between them. Each one with a different AJAX approach (as the specification says nothing on the topic). And, worst of all, incompatible with JSP/JSTL and portlet development.

So, if even the Spring people can't get WebFlow to work properly in a JSF + Portlet environment how are we supposed to do so? Do you know that you need to configure JSF RI(or MyFaces) + Facelets(or JSF Templating) + Richfaces(or IceFaces, Tomahawk, WoodStock) + Portlet Bridge(JSR-301 is in draft yet!) + JBOSS EL(you want method invocations right?) just to start developing a page? Can you guess the number of IDEs that support that kind of configuration? Or the number of context-params in web.xml descriptor? Let me assure you something, your first try won't work. Nor the second. From there it will depend if you are mixing something more like say...Spring or, God forbid, WebSphere Portal (or even other EE technologies like JAX-WS or JPA). Can you imagine trying to explain all the gotchas (nightmares actually) to a junior developer???? Or the client????

I'm amazed that some people still have hard times determining why the adoption rate of EJB 3 is still so low (I'm stupidly optimistic and I still have hopes for EJB 3.1...and, yes, JSF 2.0) but I just know that a client side JS framework (choose your destiny!) paired with DWR and a Spring centric backend just happen to work (in a fraction of the time).

5 comentarios:

Clinton Begin dijo...

I'm glad I'm not the only one blogging on this. Well done.

http://www.clintonbegin.com/2008/05/re-java-haters-gtfo.html

Excerpt: "What have these standards and specs bought us in the past? Ah yes, a tie to an app server vendor, inflexible code and stuff that breaks if you try to port it to a different app server. Exactly the problems standards should solve. Meanwhile, the Struts/Spring/Hibernate apps all ported without issue. What?! The nonstandard app is MORE portable than the standard app? If that isn't Sun's most classic failure in history, I don't know what is."

Java dijo...

Yeah right, you, CB included, took 2 standards (EJB and JSF) as bad examples (I agree EJB and JSF suck) and now ENTIRE JCP process sucks.

You are either young (not experienced enough) or ignorant to see how important standards are at all levels of abstraction. Some standards are good some are bad (JSF/EJB), but you can not start talking shit around how entire community (JCP, OASIS etc etc) which is trying to make world a better place is failure because you cant make your tiny little web application to worn way you imagine.

Quote from CB: "Exactly the problems standards should solve?"

I rest my case

Casper Bang dijo...

"The problem is the integration between them! Specially when you group them together and call it a platform."

Amen to that. The synergy and coherence is absolutely missing. It's the primary reason why development in Java is generally considered more hard-core (difficult) than developing with .NET. I'm not sure they have learned anything though, I recently discovered SUN is sponsoring two versions of what's essentially completely the same Swing component, the Outline and the JXTreeTable.

Jose Noheda dijo...

Well, it's not EJB/JSF. Portlet specification has not been stellar either. And JAX-WS while better than JAX-RPC is way complicated. But as I said in the article the problem does not rely in a specification in particular but in the usage of them combined.

And I wish I were young ;-)

Jose Noheda dijo...

@Clinton: You go quite farther than me with the argument for sure. I wouldn't blame just Sun in addition. The JCP/JSR is composed of many members and not everything is leaded by Sun.

@Casper: I'm considering an article comparing JEE/.Net in several aspects. Let's see what's the result.