This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

DWR vs prototype

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per my knowledge DWR is a tool which help us to create a AJAX application with a minimal effort. It will map the JavaScript call with the methods in Java class.

But if we use Prototype (a JavaScript API), we can do lot of Visual Efforts and making AJAX call very simple, however we have to map the server components which should be the same as we are going do with DWR (but here it is servlets)

Finally I don�t find any much difference between DWR & Prototype. Share your thoughts what DWR can do which we can�t do with prototype.
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DWR takes care of converting your Javascript objects to Java objects, and vice versa. If writing that sort of thing is appealing to you, you'll be very happy with Prototype.

Yes, Prototype certainly does offer things DWR doesn't, effects being one good example. But DWR's AJAX approach, which is markedly different than Prototype, allows you to continue to "think in Java", per se. You don't have to worry about how a given URL maps to a given Java class, and ultimately method. You don't have to figure out what call semantics and protocol to use to tell your servlets how to execute some method of some object. You don't have to worry about converting the return value from those methods into something your client can understand, JSON perhaps, maybe XML or something else. DWR handles all of that for you.

You stop thinking about servlets and requests and responses entirely with DWR, you simply think "at this point in my code, I need to execute method A of class B", and the fact that class B exists on the server doesn't mean a thing any more (other than not doing something that takes a long time when the user presses a key for example, but that's the same concern you have with *any* AJAX library).

Prototype is nice. I like it myself and have used it. I've even used it *with* DWR in the same app. But DWR's approach to AJAX is fundamentally different than Prototypes, and most other AJAX libraries out there, and it's that fundamental difference that has to be understood to see why one versus the other might be the right choice.
 
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Yes, Prototype certainly does offer things DWR doesn't, effects being one good example.

To be pedantic, it's Scriptaculous that provides the effects. But most people think of the combination of Prototype and Scriptaculous when they're talking about "Prototype"...
 
Frank Zammetti
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, you're right... I thought I had seen some limited effects in the latest version of Prototype, but I just checked and I was mistaken. So yeah, not pedantic at all, just accurate to point that out
 
Villains always have antidotes. They're funny that way. Here's an antidote disquised as a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!