The Framework That Helped Me Enjoy Web UI Programming

Friday, October 30, 2009

I hate web UI programming. I despise web UI programming. You have all that tag soup. Tag libraries and HTML and javascript and CSS hacks and business logic, oh my! No matter how much you fight to keep it all separated, it seems to run together.

You have to use clunky flows and add all this extra code to pass session variables around, held together with string constants. And if not that, then you have to deal with bloated frameworks that were designed by tool vendors (*cough* *JSF* *cough*) and don’t solve the tag soup problem. (Granted, the guys at JBoss have taken a lot of the hurt out of with JSF with Seam.)

MVC, we have tried and tried, and I personally never seem to be happy that I have actually done a good job modeling my implementation after you. The Model 2 style of Actions and Flows is awkward at best and confusing most of the time. Why can’t we write webapps like we write desktop apps, using a component-based model and none of this tag soup mumbo jumbo?

In comes Apache Wicket. Wicket is component based, but it is a lot more like Swing than JSF. You don’t have to use a stateless programming model. You can keep references to objects without putting them in the session. For real. It would be hard not to do it that way with Wicket.

Wicket separates the presentation markup from the business logic. For real. It is actually separated. I have been working on a large project using wicket for the past 8 months and we have done this again and again. The framework even enforces it. Your designer could make changes to your copy of the mockup that you put in source control and not have to worry about breaking your code. GWT (which is also component-based and liked by me) doesn’t do that. But having the designer be able to make the changes to some weird CSS bug in IE 6 is a dream come true for java developers who build highly functional websites that are ugly.

You can also do all the UI updating you can do with Swing and Wicket does the same things with AJAX. Plus, you don’t have to write any javascript! For real. It just works. Even in IE 6.

So, for those of you who hate Model 2 MVC (Struts, Struts 2, Spring MCV and Spring Webflow, and even dare I say it, Grails, etc.) and want something where the idea of creating a reusable component isn’t an exercise in frustration and you want to get rid of the tag soup (sorry JSF), then give Wicket a try.

comments powered by Disqus
Top

Matt Campbell

Recent Posts

Blog Archive