16 Apr 2011 - Digital Strategy // By Productive Edge Team

Introducing ActiveWeb – framework for rapid web development in Java

A day has come for all good men (pat on the shoulder)... to announce ActiveWeb. For those who do not know what this is, ActiveWeb is a Java framework for rapid development of web applications. The reasons why I developed it are many, but dissatisfaction with the current (bizarre) state of affairs in Java is a main one. On the one hand, the number of Java Web frameworks is mind boggling, on the other, each and every one of them is weird one way or another. Unfortunately they all suffer from a few common deficiencies:

  • They usually solve only one problem
  • They need to be integrated with one another
  • Mostly do not support TDD/BDD
  • Mostly not full stack

I'm sure there is more, but  these are first that come to mind. Let me pick one after another:

  • They usually solve only one problem

Lets say we choose JSF. This is a standard proposed by Sun based on the design by Craig R. McClanahan - the same guy who in 1998 - 1999 architected Struts 1. While JSP seems an improvement ove Struts 1, there are certain problems this technology has:

  1. JSF generates HTML, an pretty ugly one too. Asking an HTML designer to make a JSF page look pixel perfect is asking impossible.
  2. JSF serves a component state in HTML (taxing Internet traffic) or server (allocating RAM)
  3. JSF does not solves only one problem: accepting a request and rendering.

Unfortunately JSF has become a "standard" and there are many Java shops that fight it on a daily basis.

  • They need to be integrated with one another

Since in a typical web project  (even the simplest one), you have many standard requirements, you need more than one framework integrated together. For example, Struts + Spring + Hibernate + Log4J... or RichFaces + Seam + Hibernate.... or  [insert your stack here].

As you can see, it would be nice to push the button and have a complete working hello world project integrated all in one: View technology, Stuff in the middle, DB access (and a good on at that), first class testing support, logging, monitoring, security, etc.

These are all the things we need for web applications, and support exists in a variety of different frameworks. Unfortunately they are all disparate, and require a significant effort to integrate together before you can even write your first Hello World.

  • Mostly do not support TDD/BDD

When I learned Ruby on Rails, I was surprised by many things, but the biggest surprise came from integrated framework for testing of all aspects of a web application. This seemingly simple concept blew me away. While Java is a general purpose language and it has a lot of support for general programming, I'm yet to see a decent testing framework that is also integrated with a web framework... and which has also been developed specifically for web applications. For example, in a regular Java project it is usually numbingly hard to write a simple test that would allow to simulate a web request, invoke some tested functionality, allow the application to generate data in DB, and HTML by the view and then verify that the data in DB is correct and the structure and content of HTML are correct as well. One would think, that this is the most basic of requirements for a web development framework, but unfortunately this is non-existent in the Java world.

  • Mostly not full stack

Most Java web frameworks are not full stack. What does this mean? In a typical web project there are many requirements:

  1. Need to render view
  2. Need to write business logic
  3. Need to save to DB
  4. Need to manage transactions/security
  5. Need to log to files
  6. Need to write tests
  7. ... add your need here

Unfortunately, most frameworks only solve #1. There are however a few notable exceptions, such as JBoss Seam, Play Framework and Grails. The disadvantage with Seam is mostly that it centered around JBoss technologies and JBoss server, but the biggest problem  IMHO is a marriage of Seam and JSF. This means difficult HTML to work with, potential scalability problems, ugly URLs, non-REST requests, etc.  Grails is almost an exact copy of Ruby on Rails but for Groovy language. As such, Grails has all the implementations of a great web development framework. However, developers looking at Grails need to make a choice to switch to another language. Groovy is similar to Java in syntax, but has dynamic language features like those in Ruby. While learning Groovy is easier than learning Ruby for a Java developer, picking Grails still means switching to a different language. The third choice is Play Framework. What can I say.. this is a great framework and I'm surprised it is not as popular as I thought it could/should be. I discovered Play! half way through development of ActiveWeb, and found that there are many similarities. These similarities are mostly because both Play and ActiveWeb chose Ruby on Rails as a model to be replicated in Java. Both ActiveWeb and Play have their merits (I will write a blog on differences one day), and Java developers now have two choices to be a lot more productive while sticking with Java language.

Whew! If you got here, I take my hat off!

The ActiveWeb has a new home as of a couple of weeks ago, and documentation will be coming in the following days/weeks. The new home is on Google Code: http://code.google.com/p/activeweb/

Enjoy,

Igor

.

Share
Introducing ActiveWeb – framework for rapid web development in Java