Friday, October 03, 2008

Trying to find a single Java web application framework

While I like using Rails for many types of web applications I still look to the Java platform for applications requiring higher run time efficiency and to take advantage of deployment tools and environments.

The problem I am having is that I would very much like to settle on a single framework in order to reduce the effort of staying on top of too many tools and frameworks. In the past I have used JSP, my own custom JSP tag libraries, other people's JSP tag libraries, struts, various ORMs, some work with GWT, some work with Spring, and some with Wicket. I used to use the full J2EE stack, but largely gave that up about 5 years ago.

I would like to be able to invest at most 100 hours of study time, and get back up to speed on a single framework, but I am not sure which to choose. GWT is very tempting but GWT does not cover all of the types of web applications and services that I am likely to be contracted to build. Seam looks good as an integrated framework, but I need to set aside a long weekend to give it a good preliminary evaluation.

Many different frameworks and tools leads to a healthy software ecosystem, but for an individual developer it really is best to choose a small subset of tools to use for business and to set aside a relatively small amount of time (usually evenings and weekends) to keep up with new stuff. I mostly perform many small and medium size development projects for customers, and choosing a single framework like Rails (in the Ruby development space) really helps me stay focused and not waste "spin up" time. I would like to be in the same place in the Java development space.

7 comments:

patrickdlogan said...

When you write "java platform" does that rule out Rails and JRuby?

What about Grails and Groovy?

My last few Java web projects have been using Restlet. The most recent is Restlet and Groovy. This approach is very basic and easy - but it is not intended to do all the work that Rails or Grails is intended for.

These apps have been restful web services. The most recent is that with some simple xhtml generated from Groovy's xml builder.

Mark Watson, author and consultant said...

Hello Patrick,

I have used JRuby + Rails sparingly over the last year and a half (I think it was as soon as JRuby would run Rails and warbler was available).

My problem is that Java is so much faster that Ruby or JRuby. Also, I simply have some customers who want a straight up Java stack, and without too much argument I tend to do what people who are paying me want me to do.

I am going to Merb Camp in San Diego next weekend (conveniently very close to where my parents live :-) and I have some real enthusiasm for the possible speed improvements of the combination of Merb and faster versions of Ruby (1.9, JRuby, etc.) Picking up a factor of 4 or 5 in run time performance would mean that I could use Ruby much more often.

Another option is just to implement RESTful architectures on the back end and use richer Javascript clients. I have been getting more into Javascript lately, and appreciating advice in the book "JavaScript: the Good Parts" has helped me understand that Javascript really is a cool language if I am careful how I use it.

Thanks,
Mark

J.F. Zarama said...

I use GWT for certain apps but for others I use Click; have a look; intuitive, simple, well documented:

http://click.sourceforge.net/

Kevin said...

Interesting that other comments indicate using RESTful on the back end. I don't know if you have looked at Jersey, but it's just about to release its 1.0 implementation (1.0 JSR 311 spec approved a couple weeks ago). Having worked with Spring, Struts and my own incantations of MVC frameworks, I find that by using Jersey, not only is it easy to handle GET/POST requests, but I can also easily turn my server side into a true RESTful API that clients outside my own web implementation can use, if need be. It is very easy to use, so much so that I was able to implement a large portion of a "non-REST" API into REST in a couple hours, giving full true REST capabilities with ease. It does require JDK 1.5+, but with 1.4 no longer being supported that should no longer be an issue for anyone.

So I would say, take a stab at REST... it's not a full blown MVC framework, but it lends well to API development and can quite easily handle MVC capabilities. There is even a MVC demo with the project.

Mark Watson, author and consultant said...

Hello J.F., I read through some of the docs for Click: looks good, but I did not try using it yet.

Hello Kevin, I did some browsing for Jersey, and it looks interesting. A blog about integrating Jersey with publishing RDF looked especially interesting to me.

Thanks,
Mark

jmarranz said...

Try ItsNat, Natural AJAX.

In less than 1 hour you're ready to build complex AJAX applications using pure HTML based templates (web site friendly sites) and pure Java W3C APIs for the view logic.

Mark Watson, author and consultant said...

Hello JMarranz, I looked at the ItsNat documentation but did not try it.
Thanks,
Mark