javarestclient-serverenterprisedwr

What is the advantage of using Direct Web Remoting over a REST web services design?


I have an enterprise Java web application deployed in tomcat. I am looking for ways to integrate a HTML & JS UI with the mid tier java code. So far, from looking around I have read that there are two ways to do this which fit my requirements :

1) DWR - Direct web remoting

2) Use REST web services.

I am not sure which approach to use.

Edit: What is the advantage of using DWR over a rest WS design?

Is there a better approach available? Some people asked me to have a look at GWT, but I am not sure if these are scalable.

Edit 2: I will most likely be using dojo for the UI development(Works well with REST/DWR??), and I want to keep the java code chages minimal. I understand that by using web services, I would have to write an additional WS client layer on top of the existing java code.

Also, the usual enterprise needs, performance, scalability, etc.


Solution

  • Ok so you're building a web client frontend to your java backend, there are a few ways to go about this:

    Ideologically I would definitely suggest the last approach but this can be hard for large projects. If you have the hardware to throw at it, vaadin is a nice option. My JSF 2 experience was a bit disappointing due to the bugs in (necessary) third party libraries like richfaces.

    PS: I have never heard of DWR but the last stable release seems 2 years old and all it seems to do is expose java code as javascript methods which can be better handled with a REST interface.