In the spirit of choosing weapons carefully I’ve decided to start a weekly post about a technology that is currently at the top of my list of solutions for a particular problem. I like to evolve my technology stack slowly and what better way to do that than to get some feedback on the solutions I’m using and possible alternatives to them. I’m hoping that this will create an exchange about tools of the trade that will be of value not only to me, but others evaluating similar technology.
First up is
Direct Web Remoting (DWR). DWR is currently my Java Ajax framework of choice. I figure this is a good first topic since JavaScript is all the rage right now and there are a plethora of tools available in this space. DWR makes exposing server side Java via JavaScript simple and clean. Essentially you just register a DWR servlet that generates JavaScript to match your server side objects and make an XML configuration file that lists which Java objects should be exposed. You can literally be making remote calls to your existing server side objects in about 5 minutes. The latest version also supports annotations, eliminating the need for a configuration file.
In general, when I’m evaluating technologies there are a few important factors I always consider. First and foremost I look for something that provides the features needed for me to solve the problem at hand in the simplest manner possible. DWR does a good job of this. I think it’s a great example of a relatively simple solution for a complex problem. It is very easy to use yet it has the functionality I expect from such a framework.
Another thing I like to look at is a tool’s ability to integrate with the other technologies I’m using. DWR has support for integration with several common frameworks including Spring, Struts and Hibernate to name a few. I’ve personally used the Spring integration and was really pleased with it.
Good documentation is a critical factor for me when I’m choosing technologies. There is inherent risk when adopting new technology. This is one of the main reasons I feel the choice to use a new technology should be made carefully. New tools come with new problems and you need good documentation to help you tackle those problems. I wouldn’t say that DWR gets an A+ in the documentation department, but it’s pretty good. The
getting started section is a nice way to get up and running in minutes and there are several tutorials to help get you started with common tasks.
Finally, I feel that mainstream adoption is an important consideration. I don’t like to put a project at risk by adopting a technology that no one is getting behind. There are a lot of factors that contribute to the success or failure of a technology; I won’t begin to pretend that I know which unproven technologies are going to make it. DWR passes the test in this area too. Several large companies including TIBCO, Wal-Mart and American Airlines are using it.
Of the tools I’ve used for Ajax functionality, DWR is the hands-down winner. If you haven’t used it, I highly recommend checking it out. If you have used it, I’d be very interested in hearing if it is indeed your weapon of choice when it comes to Ajax or if you've got something else to recommend.