Pierce T. Wetter III has just posted an outstanding tour de force overview of using AJAX with WebObjects to the webobjects-dev list.
Myth: Rails is a better framework for Ajax then WO.
Reality: WebObjects is actually a better framework for use with AJAX then Rails because it has a better component system then Rails. You spend a lot of time coding little tiny XML and HTML generators when doing Ajax and WO’s component system makes that very DRY (Don’t Repeat Yourself).
Myth: WebObjects is hard to use with Ajax.
Reality: WebObjects is easy to use with Ajax, its just that there is only one known library for Ajax-WO support, and its not well documented. Even then the library only goes so far in that it just provides new components to wrap a few script.aculo.us tags. I think its more of a documentation gap, not a code gap.
I’m all for plugging that "documentation gap".
Update: Mike Schrag added Pierce’s post to the Programing WebObjects Wiki Book.
7 thoughts on “Ajax and WebObjects (2)”
It seems to me that WO is only a good framework for coding AJAX as long as you assume that your page will break if the user does too many ajax actions, or if your ajax responses are trivial.
This is the tradeoff:
Don’t save AJAX responses, in which case you can’t have component actions, which is pretty weak – since you’re more or less admiting that the “superior component model” can’t be used for AJAX responses
Save your responses, but risk the chance that your users will click too much on them and blow your page cache, which invalidates the component actions on the rest of your page. What’s more, I have real concerns that returning a component that changes the number of objects on a page will not work if those components have actions.
I would very much like to be proven wrong, but so far all the WO AJAX stuff I’ve seen and used has been trivial popup type widgets.
Please prove me wrong,
A couple of thoughts Kurt:
neat work with the AJAX framework and ERXSession in Project Wonder
Which I’ve investigated and was unhappy with. It did not address both the problems – just one or the other. I begin to think it can be solved, but I don’t believe anyone has done a good job just yet.
I use Direct Actions extensively and in no way has this prevented me from creating, using, or benefiting from the use of components
Then you also don’t receive the benefits of component actions – which mostly mean ease of use (programming). Direct actions mean [slightly] more code, and a looser coupling [IMHO].
I prefer to take the optimistic view
So did I, for about half a decade. But realistically, Apple has been shipping the same WO for a LONG time. The most recent reason for pessimism is the fact that Apple has been shipping JSEE 1.5 for months now, but still WO is not compatible (BigInteger problems, etc).
The AJAX problem is not a new one – it is nearly the exact same thing as the old frames problem. And I don’t think that one was ever really solved.
Don’t get me wrong; I’m looking forward to the WWDC session, and I hope this can all be wrapped up nicely. But I sure don’t think Apple will do it for us. Which is depressing – either put in some engineering time or open the source, already.
I begin to think it can be solved, but I donâ€™t believe anyone has done a good job just yet.
See? My reasons for optimism are justified 🙂
But I sure donâ€™t think Apple will do it for us. Which is depressing – either put in some engineering time or open the source, already.
I stopped being frustrated with the lack of support from Apple a long time ago. I have no control over how Apple supports WO (and they’ve pretty clearly stated that open sourcing WO is not going to happen), getting annoyed gained me nothing, and it hasn’t really changed WOs viability for my projects.
After giving this a lot of thought, and trying to figure out a clean way to deal with it, I’ve come to the conclusion that it’s beyond me. The basic problem is that parts of pages are being updated, and you can’t modify pages that are in the session’s page cache. WO simply wasn’t designed to deal with that kind of change – and who could blame them. Web pages were pages back then. WO 6.0 will need to deal with partial page updates.
You would have to replace the following pieces:
WOSession, WOContext, and (essentially) WOComponent and all subclasses.
I don’t think it will happen. Ever.
Hi, I finish a new WebObjects frameworks to make ajax use easy.
It’s doesn’t use JSON and Servlets. Actually the website is in french
if you are interrested I can translate : http://rlescot.free.fr/MyBlog/Sur%20le%20fil/C1D80B26-EA05-4ED8-8FF8-A226D0156E89.html
Hi All Experts,
I want to use AJAX (Asynchronous JAVA script with XML ). How can i Optimize the site SEO.
as Java script and flash is not recommended by search engines. Any suggestion or help is welcomed. With Regards.
Comments are closed.