Saturday, May 12, 2012

Java web development: back to basics

The first post that I wrote on this blog is titled AJAX: JQuery, Google Web Toolkit or RichFaces. There, I praise RichFaces for being built on top of JSF (Java Server Faces):

"If you haven't work with JSF, I really suggest you do as it is one of the most powerful, easy to learn Web technologies, very similar to swing with heavy use of components and events. It also has a really good support for managing the state in the server using plain Java objects (POJO’s)"

What has happened since? Well, after working with Wicket and Vaadin (which I still use in one of my open source projects), I have drifted away from component based web development.

The reason is simple. It doesn't have to do with performance, number of components or the size of the community. It's just that component based web frameworks couldn't keep the promise of isolating the programmer from client side development and the request/response nature of HTTP.

A leaky abstraction

Yes, I know. Every abstraction, to some degree, is leaky. However, the problem with this specific abstraction is that it leaks way too fast. You end up investing large amounts of time understanding how the framework works underneath and how to tweak it in order to achieve what you want. It's a real pain in the ass. The productivity that they promise in their "build an app in 10 minutes or less videos" is dead in the eleventh minute or so.

The other problem is that the technology underneath is moving too fast. HTML5 introduced a lot of new features such as web sockets, canvas and new data storage options. Web development is also moving towards stateless REST services and heavy clients. The future is not clear yet, though.

Back to basics

Lately, I have been working with Ruby on Rails and Express.js (Node.js). I think that their success lies in the fact that they embraced the request/response nature of HTTP. However, I don't buy the "Ruby made programming fun again" bullshit - a topic for another post -. I still like Java.

I also tried Play! Framework for a few weeks. It's an interesting option but I don't think that the solution is to copy exactly how Ruby on Rails works in Java/Scala. It's not really about productivity, it's about maintainability.

So, I'm actually using a super simple Java request/response based framework I made, HTML5, CSS3, Javascript and JQuery.


24 comments:

Eric Kizaki said...

Having used Wicket, JSF, and GWT, I wholeheartedly agree about component based frameworks. Trying to place some leaky layer on top of how the web works is a mistake. But I would also agree with you on the Play Framework. I also don’t like some of the decisions the Play Framework made: rich domain models that extend from some base class and Groovy templates. I also have no interest in Scala. That seems their main interest these days.

I like what you have done here with Jogger! FreeMarker is nice as a template engine. Java still does need new web frameworks because they all pretty much suck.

Corentin said...

There is another web framework that seems to do the same things: WebMotion (http://www.webmotion-framework.org) but this one use Servlet API.

Anonymous said...

I'm using jsf for almost 7 years now,
and in my experience jsf is only good to build enterprise administration-console-like applications or in places where user experience is not that much important, because as you said technology is moving fast,
these days I prefer groovy and grails or python for web development where user experience matters.

Anonymous said...

Consider vert.x? (http://vertx.io/) polygot programming support including javascript like node.js and JVM to scale.

Germán Escobar said...

@Corentin: Didn't know about WebMotion. Thanks.

@Anonymous2 Thanks for the info about vertx.io. I found Node.js well suited for some applications but its asynchronous nature adds some complexity to development. I also couldn't found a solid testing library like RSpec for example.

Igor Polevoy said...

German, I too went a similar path as you, and developed JSpec, ActiveJDBC and ActiveWeb the three amigos, that make up the Ruby on Rails. These frameworks offer soup to nuts for web development in Java, and are also based on Servlets, FreeMarker and Guice. Additionally, ActiveWeb recompiles controllers and routes on the fly offering fast development (comparable with RoR).

Igor Polevoy said...
This comment has been removed by the author.
Unknown said...

I agree with you 100%!

lk said...

But what about maintainability of request based application? How would you compare tones of lambdas in node with component abstract approach?

Germán Escobar said...

@Igor, nice effort, the projects look really good. It's nice to know that there are other alternatives to the component based options out there. Congrats and keep up the good work.

@lk Good question. I don't have a Node.js project big enough to have a word about this but I do think that all that async callbacks must be difficult to maintain. On the other hand, JSF is relatively easy to maintain until you need to do something slightly different than what the 10 minute videos show. Then, it gets tricky. I really think that there must be a middle point.

DJava Technologies said...

Thank you,
The given information is very effective.
I’ll keep update with the same.
website designing

meitian said...

dear german, i agree with you.

This Link said...

Thanks for giving us information, about this .It’s really helpful for us designing a website. Web design can be "good" or "bad" depending on, how well it achieves the objectives and/or vision of the creator and/or owner? Web design starts at the vision stage, through to planning objectives, actual web page design and possibly, the specifications.

Ron Murray said...

Rapidsoft makes extensive use of open source for application development. This includes software and tools for java application development.

+1 to your idea.

java software development

John Morabito said...

I love your blog, I recommend to all people who love this kind of post to visit this site and blog of great interest to his listeners.
Free web development.

Lars Steves said...

Thank you so much for sharing this article. I am looking forward for some more Information.
http://systronic.com.au/

Linda Grase said...

shouldn't something be said about maintainability of appeal based requisition? How might you contrast tones of lambdas in hub and part dynamic methodology?

E-Commerce Website Design//Creative Apps And Webs

Morgan said...

This program incredibly easy to set up and can be done in a number of minutes by simply following the recommendations the help you acquire a software development through which you can move on can set up the program for your web web page. All you need to do is provide them with some typical information to be able to finish the procedure.

raton pramanik said...

Primeau Productions will be your own full-service online video production company, within institution for more than 30 years. Primeau Productions owes it\'s success straight on the results That achieves for its clients. my spouse and i are generally a good results-oriented company, Equally recognized from THE published number connected with long-term, repeat customers. professional-video-recording-services

Anna said...

Great and Useful Article.

J2EE Training

Java EE course

Java EE training

J2EE training in chennai

Java J2EE Training Institutes in Chennai

Java J2EE Training in Chennai

Java EE training

Java Interview Questions

mary Brown said...

Java Training in Chennai

Devi.Angularjs said...

Hibernate Training Institutes in ChennaiHibernate Training Institutes in Chennai Hibernate Online Training Hibernate Online Training Hibernate Training in Chennai Hibernate Training in Chennai Java Online Training Java Online Training

Devi.Angularjs said...

Java Training Institutes Java Training Institutes
JSF Training Institutes in Chennai JSF Training Institutes in Chennai Java EE Training Institutes in Chennai Java EE Training Institutes in Chennai J2EE Training Institutes in Chennai J2EE Training Institutes in Chennai | Core Java Training Institutes in Chennai

sahana chinu said...

I do agree with all the ideas you have presented in your post. They’re really convincing and will certainly work. Still, the posts are very short for newbies. Could you please extend them a little from next time?..Keep this great work
Web development Company in India Company | Web development Company Bangalore
Web Development Company in Bangalore | Responsive Web development

Post a Comment