Eugene Lazutkin wrote:
> My only problem with RoR's approach in general regardless of underlying
> library is it is very low level. Essentially it is a way to propagate
> some events to the server. I am not sure I like the idea of callbacks
> for every sneeze. David (of RoR) really dislikes programming client
> side, so he moved everything he could server-side. Do we really want to
> replicate RoR? I prefer to see more widget-oriented approach.

I think its actually rather high level, in that you don't really need
to know any Javascript what-so-ever. Obviously not knowing any
Javascript will be a limitation to exactly what you can do, but the
helpers and RJS meet a lot of people's needs with a very minimal amount
of additional learning required to utilize it.

The stuff done with it also is mainly geared towards stuff that
requires server participation to an extent. If you know Javascript
well, you can reduce the traffic in the AJAX request, but you still
need some data.

Take as example, a button that when clicked, adds something to your
shopping cart, swaps in the cart element HTML, and fades it in or
something snazzy. You will need to do an AJAX request to attempt to add
it, and receive acknowledgment.

If you know Javascript, you could just keep everything client-side, and
toggle behavior based on a very simple Success/Failed response on the
cart add.

If you don't know Javascript, but use Rails style helpers, you'd
instead just update the cart element with the reply from the server,
etc.

So you send slightly more data over the line, but very little knowledge
of Javascript is needed.

However, if you're building a "real" interactive AJAX application, you
will no doubt need to know Javascript. The RoR helpers won't help you
as they hit a very specific range of use-cases common in many webapps.

> While it reminds me of extending command line utility with GUI dialog
> boxes in some places, it works. We have to support this style of Ajax.
> But it would be better if we offer something more original and more useful.

I agree entirely, though usually once you get too far past the basic
cases the RoR helpers account for the "genericness" starts to break
down. The common problem with widgets is that you'll spend as much time
customizing them for your need, as you would writing one that solves
your need from scratch.

If the widget itself can be broken down into the generic portions, then
you'd be able to quickly build custom widgets that do exactly what you
want. That'd be ideal I think, though I'm not sure what these generic
portions would look like...

- Ben

Reply via email to