July 17, 2011

The “Just Works” Generation

Posted in Uncategorized at 8:26 pm by dgcombs

I've given some grief to Ubuntu (with its new Unity Interface), Meego with its "kiddish" interface and even Chromium OS for its lack of flexibility. What do I want? I want, like Steve Jobs says, "It just works!" Or do I?

I recently took on the task of pushing out a Federated Identity application based on SAML 2.0 and using Oracle Identity Federation. No question, the project was in trouble. The identity provider was producing assertions that couldn't be verified and consumed. The service provider sessions were rejecting everything. There was no getting around it. It emphatically did NOT work.

Among other things, the application was parsing the SAML assertions using Simple API for XML. Also known as SAX, this software has been around for quite some time. In fact, that's one of the things I noticed over the last two weeks of exercising my Google-fu. It's so old and so common that several bloggers have taken example code and commentary directly from the Oracle and SUN and IBM manuals and posted it as their own work. At first I was somewhat amused. But my goal was not amusement but to get from the NOT WORKING state to the JUST WORKS state.

I would suggest anyone looking into SAX for XML parsing start with, of course, Wikipedia's article. There you'll also find a few pointers to articles which actually know what they are talking about. One of them, Chapter 6 from Cafe Con Leche is actually quite good. Another source I found indispensable was an XML Tutorial from To the River. And of course, author David Brownell of O'Reilly's SAX2 provides Top Ten SAX2 Tips. (Update your blog, David!)

I now understand a lot of how SAX works. I get that the parser is separate from the document handler. That the parser calls methods in the document handler to, uh, handle events which fire in response to structures found in the XML document (like start of document, start of element, elements, end of document to name a few). I didn't understand that before. In fact, I didn't know it even existed. As long as it just worked, I had no need to figure out how and why it worked the way it did. Or, in this case why it didn't work the way it didn't work.

The final problem wasn't really a problem with the SAX parser or the document handler or the callbacks which fire during the parsing of the document. It was a pesky little return value that wouldn't return a value. I tested it all the way through the process and found that as long as the parser was parsing and the document handler was handling, the variable had a value. But when they finished, it went all blank. Fortunately I stumbled upon one more resource that helped resolve that issue. The good folks at Code Ranch apparently enjoy working over the weekend and provided me a few pointers that finally put that issue to bed.

I have to say, if I had to recalibrate the color scan lines, frequency generators and sound side-band modulation phase shift every time I wanted to watch a movie, I'd read a lot more books. And maybe that wouldn't be such a bad thing.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: