JavaJava based frameworks for Ajax development are everywhere. Each of them provides a slightly different technique catering to the skills of some Java developers. But if you have tried developing an application or creating a website using Google Web Toolkit or GWT, the gist of the idea is basically there.
After all, GWT is practically the leader in Java frameworks that aims in developing Ajax based websites. GWT literally translates your Java coding into JavaScript so that it could be applied to create an Ajax based application. Sites such as Gmail and applications such as Google Earth are some of the best Ajax based applications developed by Google – all built with GWT.
Yet another framework was developed almost a year before Ajax was made. Direct Web Remoting or DWR was developed by Joe Walker in 2004. Slowly, it gathered following from different developers and its popularity increased exponentially the next year when Ajax was first introduced to the public. Today, it is one of the highly discussed frameworks among developers.
At first glance, DWR might look like another Java-based framework that translates the codes to JavaScript – thereby developing an Ajax based application. However, close examination of the process of DWR will reveal that even though the face of the application is JavaScript, the architecture is still controlled with Java. The ability of Java to control JavaScript actions and functions independently has earned its name as a remoting framework.
DWR was able to do the remoting function because of its unique communication protocol with the client side. Instead of translating Java codes whenever a function is needed, the client side communicates to the server through the Servlet API which is built using Java. This servlet API “adapts” to JavaScript becoming the communication device between the Java framework and the JavaScript coded application.
When the DWR was launched, it never thought it could be using too much asynchronous function since this was built before the hype of Ajax. Naturally, it did nOt have enough tools that could enforce asynchronous behavior. Luckily, DWR is still a coded framework that developers would just have to add another parameter to ensure the asynchronous behavior is still there. All you need to learn is to properly configure your Java so that it could be well represented when they are rendered as JavaScript.
Another concern is the functions available in DWR. Since it controls JavaScript, the functions created through Java should be very specific and precise for the framework. That was also answered through the vast library available for developers who are interested in building specific functions.
The best part of DWR is that it is free. This open source framework has been going around the internet for so many years and developers have exploited every bit and pieces of DWR that it is almost impossible not to find the right answers to the specific problems. The documentation of that comes with the framework is more than enough to give developers a fair explanation on what Direct Web Remoting is and how to use it to the developers advantage.