• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

DWR vs prototype

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I'm full of tinier men! And a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic