Johan's blog
A JavaOne session with lots of wisdom
On my way back home, I am thinking about which JavaOne sessions I really learned from. There were a couple of interesting things about OpenSocial and Shindig, and of course I attended a number of interesting GlassFish sessions. But the session that gave in my opinion the best information to developers was Adam Bien 's session on the Java SE and Java EE platform.
Adam discussed some of the issues that EJB developers encounter in everyday's projects. I particularly liked his session since it had a high "cut the crap" attitude. More concrete, I remember two of his statements that may sound controversial:
- Don't distribute (when it's not really really needed)
- Be careful with adding external frameworks/libraries
It wouldn't do justice to Adam's talk if I was just minimizing his session to these two points, but for me they are pretty important.
Don't distribute
Today, many projects get layered and prepared for scalability without a reasonable guess on the expected load. In many cases, a system designed for local access (e.g. a war and an ejb-jar inside the same EAR on one server) can handle a considerable amount of load. If you don't expect high loads, you shouldn't use remote EJB's including all the penalties they come with. Nothing wrong with remote EJB's, they're one of the best inventions since RMI, but you should use them when they are required.
External frameworks
I am careful when commenting on this, since I know that a lot of people out there are very happy about the external framework and libraries they use. Also, if you look at DaliCMS, we use a number of external jar files there.
However, as the members of the DaliCMS development team are very much aware of, I am strongly against adding another library unless it is really, really required. And really, really required means that you can't do the same with the standard Java API's.
This is also something Adam Bien pointed out during his talk: there are a lot of Java API's, use them. Personally, I think that history had an influence here. In the early days of Java, the J2SE set was not that rich. External organizations came up with very useful libraries. Today, however, the Java API itself (well, everything starting with java.) it very rich. In my opinion, it contains more than enough utilities for String operations, logging,...
Keep it simple, keep it standard. Keep it Java.
