Archive for June, 2006

h1

Object Oriented PHP

Wednesday, June 21st, 2006

Last week I received a complimentary copy of fellow Torontonian Peter Lavin‘s new book, Object Oriented PHP, published by NoStarch Press. I’ve had a couple of really good books from NoStarch (Absolute OpenBSD is indispensable if you use that OS) and this is no exception to that trend.

The book introduces Object Oriented programming to PHP programmers, starting with PHP4′s OO implementation and demonstrating the advances made with PHP5. A simple web application is built by starting small and making incremental changes, sequenced in such a way as to introduce OO concepts and solutions in a natural way, increasing in utility and complexity as the lessons progress.

I’m only a few chapters in right now – there is certainly more to the book and I’m looking forward to the rest.

The companion website has a lot of useful reference material and links to resources, as well as the book’s code and errata.

h1

Reference for Ajax Transport Layer Alternatives

Thursday, June 8th, 2006

(via Ajaxian) IBM Developerworks has just published an Ajax Transport Method tutorial that describes a few of the alternatives to XMLHttp and provides example code to make them work.

For a more complete reference to all the available Ajax Transport layers, see my constantly evolving Ajax Transport Layer Alternatives presentation documentation. As someone who has actively used and promoted these techniques since 1998, I can say that I’m pretty familiar with the entire gamut of methods and their pros and cons.

The universal acceptance of the Ajax meme only became possible after more than 7 years of evolution and convergence of tools and techniques – CSS and DOM for presentation, XML and JSON for encoding, and various transport layers.

Much of the experimentation that took place during this time was centred around finding a way to transport data to and from the server in the background. Java applets, frames, layers, hidden iframes, image tags, script tags, XMLHttpRequest and Flash were all put to the test, each solving parts of the problem but mostly failing on compatibility, reliability or unwanted sideffects. XHR’s failure to take hold for the first 5 years of its existence was due to it being implemented as an ActiveX control only available in IE.

When Mozilla, Opera and Safari included the XMLHttpRequest object, it finally became the “good enough” solution upon which the Ajax juggernaut was launched.

While XMLHttpRequest has served to bring us to this stage in the game, it has some serious shortcomings that limit its long-term utility. As far back as 2002, Scott Andrew LePera pointed out an as-yet unfixed implementation problem, and more recently, Alex Bosworth enumerated a whole raft of issues. Harry Fuecks has spoken eloquently about network reliability and latency, the solutions to which would be best addressed with better control over timeouts, retries and error handling than XHR can provide.

As I’ve mentioned many times, Douglas Crockford’s JSONRequest proposal is one of the first real attempts to begin the discussions necessary to bring the changes about that will solve these issues. There was futher discussion at The Ajax Experience that included the major browser vendors, so I’m hoping that some from these beginnings, momentum will build.

Until there is a purpose-built Ajax transport built into browsers, advanced developers may want to learn all of the ins and outs of the different alternatives in order to choose the one that best fits the problem they are solving.

h1

More on Ajax development tools

Thursday, June 8th, 2006

Jordan Frank of eBusiness Applications had an article on Ajax development published last November, in which he describes some of the Javascript debugging tools available.

I met EBA’s CEO Andre Charland at Ajax Experience and we shared some Canadian hilarity, as you do. Seems these EBA guys are all hella brainy.

h1

Ajax transports still need to evolve

Tuesday, June 6th, 2006

Michael Mahemoff talks about Ajax transport layers and their problems.

In my Ajax Experience presentation last month, I covered all the available transport layers, their history, pros and cons, and provided some example code. My main intention in doing so was to demonstrate that there has been over 8 years of evolution of Ajax-related techniques to bring us to where we are, and to underline that Ajax is not a done deal, there is still work to be done.

The ReadyState 3 issue that Michael talks about has been well known (well, apparently not well known) at least since Scott Andrew LePera described the problem in late 2002. It really needs to be fixed.

Cross-domain issues also still need to be addressed. I spoke to Brendan Eich from Mozilla about this at the conference and he mentioned that there are other W3C specs that use access control lists, which may provide an existing base upon which to build an XMLHttpRequest ACL model. Laurel Reitman on the IE7 Team was also involved in discussions about this issue.

Douglas Crockford‘s JSONRequest proposal goes a long way towards suggesting solutions to the various limitations of the current state of available Ajax transport layers.

Jesse James Garrett communicated very clearly in his keynote that Ajax is no longer an acronym to be limited to its original initials. According to Jesse, as long as these two basic ingredients are involved, what you have is an Ajax application.

  • asynchronous interaction model
  • browser-native technologies

Hopefully, organizations like the new OpenAjax Alliance will be able to reach consensus on what needs to be done and how in order to take us to the next level in Rich Internet Application evolution.

h1

Prototype group on Google

Tuesday, June 6th, 2006

(via James McFarlane) For those of you (and I know there are many) who find it difficult to understand Sam Stephenson‘s Prototype library without a definitive roadmap or documentation, there is a new Google Groups Prototypejs group where you can at least commiserate with others in the the same boat, and at best share tips and collaborate.

h1

Ajax on IE7: make sure you invoke native XMLHttpRequest object

Monday, June 5th, 2006

Through working with the IE7 team, we’ve figured out the problem behind the IE7 XMLHttp resend issue I reported a while ago.

The short answer is this – we’ve demonstrated that in our app at least, IE7 resends its XMLHttpRequest data if you use the ActiveX XHR object, but works correctly if you use the native IE7 XHR object. Be sure that your XHR-creation code uses “new XMLHttpRequest()” to invoke the object in IE7 and you will not have the problem.

Tim Aiello explains in more detail.

h1

Ajaxio proof of concept for Ajax Visio functionality

Thursday, June 1st, 2006

I’ve been acquainted with James MacFarlane for a very, very long time. I first met him in the early 80s when he wrote articles and columns for various Toronto-based computer trade magazines and was active in the tech community. A few years ago, long before the Ajax revolution, he was managing a dev team at Moveable Inc and had me in to give a presentation to his staff about Remote Scripting and related techniques.

Always ahead of the curve, James is at it again with a new proof of concept called Ajaxio, that does Visio-style stuff in the browser. This is an excerpt from his demo page:

The purpose of this experiment is to see if a Visio-type of tool could be developed in a web browser. Using Prototype, script.aculo.us and Water Zorn’s SVG library I managed to hack together a simple demo. It’s not perfect, but it demonstrates that it can be done. There is no Ajax writeback to the server in this demo, but it could be easily added as a call in prototype.

Neat stuff.