Wednesday, April 25, 2007

Howto: IE6 and IE7 Ajax caching fix

My company's product frevvo Live Forms makes heavy use of Ajax, especially in the Form Designer. We had to work around a number of interesting "features" in good ol' IE6 (and now IE7). One of IE's stupidest quirks – among the many endearing features that have cost us hours – is that it caches responses to Ajax requests. Doh! By definition, Ajax requests are supposed to be dynamic so caching the responses is one of the dumbest things around.

frevvo's architecture is essentially a Model-View-Controller (MVC) pattern in the browser. I'm doing a bit of hand-waving here but the model in the browser is essentially a stub that updates the actual model on the server using Ajax. When designing a form, if you move a control around or modify one of its properties, your browser will update the server model via Ajax. For large forms or large schemas, browser performance at initial load time is a big issue (more on this later) so Live Forms dynamically generates the XHTML for a Section in the form when it is expanded or a complex element in a schema when it is expanded.

Unfortunately, IE6 and IE7 cache the Ajax responses. No matter how often you refresh, IE will still show the old XHTML. Fortunately, the workaround is relatively simple – just add a random number or timestamp to the URL, as in the block of code below (uses Ajax.Request from prototype):

editControlType: function (controlId, onSuccess,
onFailure, options) {
var requestUrl = this.controlUrl(controlId) + "/editor" +
"?edit=true&random=" + Math.random();
Object.extend(options, {
method:'get',
onSuccess:onSuccess,
onFailure:onFailure,
onException:this.onException
});
new Ajax.Request(requestUrl, options);
}

This is the only reliable solution I've been able to find. Cache control headers don't work reliably either – I haven't been able to figure out IE's algorithm for this. It appears to ignore cache-control headers most of the time.

With the unique random number parameter, IE now thinks it's a brand new URL, and does not display the cached version. Whew!

For the record, I'm not randomly biased against IE. FF and Safari have their own set of issues but, honestly, they're nothing compared to IE.

Tuesday, April 24, 2007

Web Oriented Architecture (WOA)

My friend Jérôme Louvel wrote about web oriented architecture on his blog and it led me to these posts by Nick Gall and Dion Hinchcliffe.

I like Nick's shorthand version: WOA = SOA + WWW + REST, Jérôme's definition: an application of the REST style for building Web services based on straight HTTP and XML documents, and the image towards the end of Dion's article.

I've been contemplating my company's product frevvo and it's connection to the SOA world and it seems to me that we put the WWW (the face) in WOA. Let's say you have a REST style application – all it uses is HTTP, JSON and POX (plain old XML) – and have created some services. How can users consume these services – does the WWW above simply mean "use HTTP to access them"?

frevvo lets you create front ends – things that users can touch and feel (in their browsers, of course) and that can interact with these WOA services. Without it, a WOA has no face and without a face, it's hard to create a user-oriented application.

Incidentally, frevvo is, itself a REST style application (HTTP+JSON+POX): we'll be publishing the REST API soon. The server-side was heavily inspired by Restlet (Jérôme's project). Unfortunately, Restlet was nowhere near ready at the time but we hope to adopt Restlet in an upcoming version. It's very cool – check it out. And, hopefully, when you create your web applications using Restlet, you can put a face on them with frevvo.

Monday, April 23, 2007

frevvo and Metaserver

Wow! We've finally released Version 1.0 of frevvo. As usual, it was harder and took longer than we expected. Part of it was for good reasons: we got some interesting feedback from our Beta users and we decided to take the time to implement a couple of features.

It sure was quite a journey – we had plenty of ups and downs but fortunately many more ups than downs. It's been quite different from my last company (Metaserver, which was acquired by Whitehill Technologies). Unlike last time, we didn't raise any money, didn't try to rapidly grow before we had any customers and just took a different path – we've behaved like a small company. And, interestingly it's not been much harder to do. I suppose the fact that nowadays the cost of software, hardware etc. is essentially zero helps but we haven't really missed the people that we had last time, at least so far. It sure looks like the trend – so many products/companies are launched in less time and with far less money than before. We'll have to wait and see if more of them end up being successful than last time but I've got to believe that fiscal discipline from the get-go is a good thing.

Anyway, congratulations to Yuri, Nancy and Leandro and thanks for all the hard work that's been put in over so many months to get frevvo out the door. It's a cool product for sure and one that we hope is going to prove very useful for a lot of people.

Wednesday, April 18, 2007

Yale Golf

For golf-lovers everywhere, check out these great pictures of my home course - the Yale Golf Course. It's an amazing golf course that's really come on strong in the last few years thanks to our new superintendent.

Now, if only I had more time to play there :-) Hard to do that when you're also working on a cool new startup. Someday ... but, if you come down to the New Haven, CT area drop me a line.

Geek Culture

I stumbled upon this awesome geek culture gallery. Some of these pictures are cool and some are downright scary :-)

Tuesday, April 17, 2007

From WikiPedia: A whole product is a generic product augmented by everything that is needed for the customer to have a compelling reason to buy. The generic product is what is usually shipped to the customer. The whole product typically augments the generic product with training and support, manuals, cables, additional software or hardware, installation instructions, professional services, etc.

For my company, frevvo, I like this picture from this article by Don Thorson.

It always comes down to a few basic rules as Don says. What about frevvo and our Live Forms product?

Does it solve a problem? We think so for sure - lots of people and companies need/use forms. Live Forms is affordable and works equally well for really simple registration forms that send an email all the way to complex business forms.

Is it easy to understand? I think we can definitely do better here. We're working hard on: more examples (you can already find quite a few at our company blog), video tutorials are in the works, templates (which provide a starting point) are coming real soon. I don't know about the "Mom test" – but I did the "Wife test" and she likes it :-)

Is it easy to get? Definitely. We have free trials, we have a free version. The cheapest version is as low as $10/month. It's very simple and easy, nothing to install, no database to configure etc. There's a downloadable version available so it's very flexible as well - if you want to install it in-house go for it. You can get it right off our web site.

Is it easy to use? For sure though we can do better here as well. Let's see ...
The easy parts first:
zero installation, drag & drop/visual form creation, XML/XSD aware so it's easy to integrate, it's really easy to create dynamic forms – in the "Wife Test" my wife loved the dynamic pick lists.

The not so easy parts: Simply email me a [generically] formatted document or stick the data in my database. Both are coming very soon. Styling the forms can be tricky but more themes are coming very soon. It's hard to figure out why a rule isn't working. We're working on fixing this in an upcoming version.

Is it easy to share? I would say, not especially. It's not hard to share but we haven't really actively done anything to let people do this. So, what can we do? We're working on a couple of sharing tools: showcase your cool form or service that process the XML documents generated by our forms.