DWR Rules!

I've been using DWR quite a bit on a new Java application, and WOW, it's awesome.  It's not really that different from any other JS remoting toolkit, but it is really slick.  In a nutshell, you declare "remotable" objects (mine happen to be Spring-configured services) along with what methods are remotable, and any complex data types (e.g. beans) that need to be marshalled in an out of the method invocations.  Then you just add a JS file to your page and start calling methods on your remotable objects just as if they were local.  Really slick.

I think what really sells it is the zero-config client usage.  No defining a gateway, no extra methods, just "normal" client-side code.  The only exception is the use of a callback instead of a return variable from methods (so they can run asynchronously), but still very elegant.

I'm a big fan of AJAXing HTML applications on an as-needed basis.  It lets you keep your application in HTML (which is fast to code and easy to maintain), but lets you give certain areas a richer UI, without having to go all one way or the other.  But let me tell you, over the past few weeks I've shifted my thinking and have started building basically static HTML pages and doing everything dynamic with remoting.  Very much the Flex paradigm, but realized in HTML, which is awesome because you can still go with HTML for part of the app.

I know I've not really said much (and managed to spent three paragraphs doing it), but of all the new stuff I've been using on this project, DWR has had the most WOW impact, which is surprising to me since it's band of utility is pretty darn narrow compared to something like Spring or Hibernate.

2 responses to “DWR Rules!”

  1. Patrick McElhaney

    Sounds cool. You forgot to include the link though. :)

    http://getahead.ltd.uk/dwr