This post is going to talk about using Frameworks (JSF, ASP.NET, Django, Ruby on Rails…) to build web applications and perhaps they have outlived their usefulness in many situations.
I have started to put together a demo server here at deCarta and as part of that I am going to need to write some demos. I know that when I write some MS based demos I will be using ASP.NET since that is was one of the benefits/drawback of MS development - one “blessed” web framework.
It has been a while since I have written some Java web applications and so I thought I would peruse the landscape. I have worked in JSF before but the XML hell that is the configuration files really harshes my mellow. That being said Seam seems to be an interesting framework but there is certainly a steep learning curve and I am still unclear if it runs on Tomcat. I then find Wicket which has no XML config files and everything is done through Java code - which appeals to me. I use an IDE so it can help me avoid doing the mundane and repetitive tasks which are prone to error. Most IDEs have no way to confirm that you don’t have typos in your XML or your XML declares a non-existent class. So Wicket, using nothing but Java code, feels like a step forward… until I look at the amount of code and classes needed just to do a simple form. Feeling undeterred I try to get going and then realize that Wicket documents relies heavily on Maven, and while I have nothing inherently against Maven it is yet another thing I have to learn that I am not in the mood to do now.
Now feeling a bit frustrated I go speak to Geoff and Brent, our web services and JavaScript gurus respectively, to seek words of advice. Turns out they have used Wicket and a bunch of other frameworks and they say, as somewhat devil’s advocates, that frameworks are a waste of time. They now believe that most web apps should be written as Servlets or web services which feed appropriate data to your JavaScript library of choice. I push back a bit and they do concede that for large team projects or repeatable projects a framework makes sense but they also point out that that you spend an inordinate amount of time wrestling with the framework rather than writing code.
And this is the question for the day - has the evolution of web development moved us away from frameworks as the one true way for web developers. All the web languages out there now have their own frameworks, from perl to Ruby to .NET to Java, are they overkill for most projects. Is there where REST and Ajax (and Comet soon enough) have brought us?
When I discovered Struts it was like a ray of light cutting through all the one-off web code I had written. But are we now at a point where the frameworks and the support infrastructure are just too much hassle without enough payoff. I understand sessions are another tricky thing that frameworks help handle but perhaps that is all the frameworks should do. Programming servlets to accept GETs or PUTs and having them spit out XML or JSON is really an order magnitude (WAG ) easier than taking on a framework. It seems some in the Java community are also discussing this issue (look in the middle of the Seam discussion for the grey box which is Matt’s commentary ).
So lazy web what do you think - has the time come to give up on these heavy frameworks and move to something more lightweight - REST services with an AJAX library fronting it? Or is this just a lazy person trying to get out of doing the hard work climbing a learning curve.
For those in the geo community this would like moving from an ESRI ADF or MapGuide to something like OpenLayers + GeoServer’s KML API.
I would really love to get some more data points from the community…