Saturday, January 19, 2008

Ye Ol' STRUTies, Wake Up!! The new world is here!

There are more than 60 active web frameworks in the market! How many do you know??

If you ask me... I only know Struts 1.x framework pretty good. So good that I know where are its dark alleys, how to avoid them, how to venture into some of those alleys without getting seriously hurt.

We all have grown so much accustomed with Struts 1.x that we have now blindfolded ourselves from looking into anything new.. Something which would break away from traditional way of framing a web-application. Enter Wicket, and you are due for a surprise!

I am NOT going to tell you here how to work in Wicket. This post is NOT a tutorial for wicket. I would try to give that one soon as well.. But there are numerous tutorials on net.
This post is just raise your curiosity about this new framework. Here are few highlights about how wicket does things differently.

  1. Real separation of concerns

  2. In Wicket, the entire presentation work is done in plain-old HTML (!!! Yes boss. You can kiss goodbye to all jsp, jsf, jakarta taglib, jstl, custom taglib). Due to this, now you can really have one team working on presentation layer (the designers) and other team working on development of server side dynamic pages (java geeks).

  3. No JSPs

  4. Did you ever feel that you had to write soooo much of jsp code to achieve so little? Try wicket. Since you don't have to force yourself to write stuff in jsp which was really meant to be done in java, you would feel liberated! The productivity increase would be clearly visible to you. E.g. Remember when you wanted to display a dynamic HTML table, you had to create the soup in jsp files by using logic:iterate (or c:forEach) and all sorts of logic tags to check present of fields etc etc. This is supposed to be a java code but we were forced into writing cumbersome taglib code to avoid the scriptlet usage in jsp. With wicket. You just write your regular HTML table with a dummy data row and then let java do the trick of iterating over the collection, checking for nulls / empty, anything. Whatever you can do in java, you can do to get your HTML table generated. No limitations.

  5. AJAX

  6. Wicket has has built in support for ajax. If you want to extend the support, you can easily do so. Also Wicket can easily coexist with existing JS lib like prototype / Dojo.

  7. URL Mounting

  8. You can create bookmarkable "friendly" Urls with one line. [If the url is behind a security, it would be displayed after intercepting login screen]

  9. Unit Testing

  10. The new world Java development is all about Unit test driven Extreme Programming. Wicket component are completely testable by using EasyMock objects.

  11. Validators

  12. Rich and far-reaching validator framework. don't need to use commons-validator. Validation failure message can be easily shown back to user in feedback panel / or you can customize to show the field in error highlighted. You can also ajaxify the process of validation.

  13. Spring Integration

  14. Easy in making coexistance with Spring and Hibernate, if that is selling point for you.

  15. Compile time issue detection

  16. You can catch problems at compile time which are not possible with JSP. For example if in JSTL you were referring to a non-existent Javabean property, you may not know until the page renders.

  17. Consistent look and feel for the pages: Templates without jsp / tiles

  18. No need to have jsp:include or tiles to define the template for your portal page to achieve consistent look. Wicket gives two ways to handle this functionality. Using "markup inheritance" (add link) and panel (add link)

  19. Lighter app requirements.

  20. You do not need tools.jar anymore in classpath since there are no jsps! Neither you need jsp-api.jar from j2ee web-container.

  21. No jsp compilation for the first time.

  22. Pages are no longer slow the first time you access them because there is no more JSP compilation step

  23. Standards compliant

  24. Your pages are guaranteed to be XHTML compliant

  25. Active and helpful community

  26. Help is fast on mailing list.



If you think that wickets seems to be any worthy of your attention..
Here are quick links for you to explore further:

Credits and Thanks:
I would like to thank the authors of few internet posts who elicited many of the above points beautifully in their wicket posts.


Regards,
Vijay Dharap

No comments: