Martin Gainty wrote:

> Many Thanks for the link ..does anyone know if there
> are any comparisons (performance/ease of use) of DWR to other render
> libraries such as Dojo?

I'm not personally aware of any real comparisons, but I can certainly
answer anecdotally since I have a complex app at work that has taken most
of my time over the past year that uses both, not to mention having used
both in my books.

First, it's only right to point out that it's not really an
apples-to-apples comparison because Dojo doesn't say anything about what
happens on the server, whereas DWR obviously does.  Also, DWR is Java-only
(at this point), which changes the rules of the game a bit too.

With that in mind, I personally believe DWR is easier to use.  If you look
at the syntax of the calls from the client, it's not all that much
different.  DWR may be *slightly* simpler, but not enough to really matter
much.  Where the ease of use comes swings in DWR's favor though, in my
opinion, is with the server-side if the equation.  The overall
architecture, conceptually is simpler with DWR: you don't have to worry
about server-side code to generate JSON in response to an AJAX call for
instance, which you would with Dojo (or XML, or your own custom format,
the point is you have to generate that output yourself).  All you do is
(typically) creates some POJOs, and pretend you're calling them like you
do with any Java code.

When you draw a diagram of an end-to-end AJAX request for Dojo vs. DWR,
the diagram for DWR tends to be simpler and easier to understand, if only
because you're skipping some steps (unless you spell out all that DWR is
doing behind the scenes, but that's unfair because as a developer you
shouldn't have to worry about any of that).  With Dojo, you have to
explicitly spell out the transport mechanism, i.e., what data format, any
data flow control issues, to some extent the callback code (which is
somewhat less of a concern with DWR), and so on.

None of that is meant as a slam of Dojo by the way, but DWR being an
end-to-end solution I think quite understandably removes some of the
details from your list of concerns that Dojo leaves for you to handle. 
Ironically, I usually rail against such (apparent) loss of control and
flexibility, but DWR is just so elegant for a Java developer, it's hard
not to feel like you're actually getting MORE control and MORE
flexibility.

DWR also makes reverse AJAX far easier than it ever should be!  Having
hand-coded that stuff once myself I very much appreciate all that DWR is
doing for me there.

As for performance, that's tougher... again, with Dojo not saying anything
about what the server does, you could go off and code something more
efficient than DWR, or lots *less* efficient.  What I definitely can say
is that DWR performs quite well, as does the basic AJAX functionality in
Dojo.  We have Struts behind Dojo in parts of one app, and it performs
very well.  We use DWR in other parts and it too performs very well too. 
Neither is perceptibly faster than the other from a user perspective, I'd
have to actually profile everything to see any difference there might be.

If you're just talking about AJAX functionality, and leave all the rest
that Dojo can do for you out of the question, I don't think you can go
wrong with either.  But, if you're specifically a Java developer, I think
DWR wins out just because it really changes the whole underlying
architecture of your applications to something *much* simpler.  You stop
thinking about webapps in terms of pages and request/responses and more
think of them in terms of remote object, remote procedure calls.  You get
that clean design naturally and easily, and my experience tells me it's
performant too, so a win on just about every count!

> Martin

Frank

-- 
Frank W. Zammetti
Author of "Practical DWR 2 Projects"
 (2008, Apress, ISBN 1-59059-941-1)
and "JavaScript, DOM Scripting and Ajax Projects"
 (2007, Apress, ISBN 1-59059-816-4)
and "Practical Ajax Projects With Java Technology"
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to