The World’s Leading Microsoft .NET Magazine
   
 
The .NET Addict's Blog

My Top Tags

                                                           

My RSS Feeds








Latest Diggs - Programming

Internet Blogs - Blog Top Sites

Site Hits

Total: 2,639,104
since: 19 Jan 2005

How to upset someone you admire with one blog post

posted Thu 10 Jul 08

Just recently I put up a blog post talking about consuming a POX service using Cocoa. As it turns out, Aaron Hillegass had some sample code in his book that does just that - it consumes an Amazon.com service that returns book information.

In the course of writing this post, I made some statements that I thought were funny and sarcastic. Turns out that when I went back and re-read the post, those statements seemed to be in really poor taste. This is really a big problem with blogging in general as we don't have the same rigorous editorial process that we have when publishing printed material. If I was writing a chapter, a copy editor or a trusted colleague would've said, "Hey, this joke doesn't work. In fact, it sucks. Cut it.". But, when I'm writing a blog post at 1am while watching re-runs of Battlestar Galactica on UHD and trying to create the world's most awesome creature in the Spore creator, I can look at my blog post and thing "OMFG that's gonna be funny" whereas, in my right mind, I would've said, "OMFG that's gonna be ass." and reworked things. So again, my bad - I am really sorry.

So, I am really sorry that the tone of my previous post was in bad taste and my "sky is falling" joke about following Hillegass' example was entirely too dry and sarcastic for a medium that cannot convey tone of voice.

Hillegass is the King of Cocoa. Its his day job, it's his not-so-day job. It's what he does. I'm just a .NET developer who tinkers with Cocoa. Obviously he's going to know that NSXMLParser is faster than NSXMLDocument, but my post wasn't about XML parsing. It wasn't about performance. It was about a design pattern.

The purpose of my post was about keeping concerns separated and making my application easier to maintain. The issue I had was in storing the XPath in the column identifier inside Interface Builder. I personally dislike this option for many reasons. Here are a couple of them:

 

  • Web services, contrary to popular belief, change. When they do change, they break their clients. 
  • Storing the XPath in the column identifier means that my GUI cannot be used with anything other than an XML source, and specifically that XML source and no other.
  • A change to a web service wire format is a low-level network plumbing change. If I have to open up Interface Builder to modify my GUI because a low-level network change occurred, I personally feel like I've got too much tight coupling going on.
  • A GUI set up this way is not independently unit testable. Sure, I can test the controller to verify that I'm getting data from the web service, but I can't test my model (because it doesn't exist), and I can't test the GUI without a live connection to the web service. In short, there's no easy way to feed mocks to this GUI.
  • I like having an anti-corruption layer between myself and third party web services. I've consumed enough web services in my career to know that this is a really, really good idea. Storing XPath in IB directly like that gives me no ACL and, over time, will probably make me start doing things to my app that I wouldn't otherwise do just to accommodate the web service.
So hopefully that's all cleared up now. If you've read any of my posts in the past you know that I've always recommended that any new Cocoa developer needs to own Hillegass' book so it's a little disheartening to find out that the author of Cocoa Programming read your blog only to find out that he didn't like what he saw ;)
 
I think my next step is to try and consume a POX service from Cocoa using his suggestion of the NSXMLParser for performance but to also use my own domain-specific model objects so that I can have my anti-corruption layer and testability. If I get that working I'll post it up here. 

 

tags:              

links: digg this    del.icio.us    technorati    reddit




1. Kevin Hoffman left...
Thu 10 Jul 08 6:28 am

It's also worth noting that I would feel the same way about WPF as well. If a low-level networking change occurs such as a change in the XML format of the service I am consuming and I have to change my XAML to account for that change, then I would also feel like I have too much tight coupling going on.


2. Aaron Hillegass left...
Thu 10 Jul 08 11:11 pm :: http://www.possibleprobable.com/

Kevin, I really appreciate this posting; both the tone and the thoughtful technical points. I think your blog is, in general, great. Please keep up the good work. I'm sorry I was such a grumpy old man.


3. Adron left...
Thu 31 Jul 08 1:09 am :: http://www.adronbhall.name

" This is really a big problem with blogging in general as we don't have the same rigorous editorial process that we have when publishing printed material."

No, actually that is exactly what is great about blogging, it is the unedited truth from people instead of the sugar coated media facade we've grown so accustomed to - and so accustomed to ignoring.

Don't apologize or make excuses for blogging, just keep it up.

btw - decent entry.


Tag Related Posts

So I'm in the LA Times ;)

Wed 27 Aug 08 2:51 P GMT-05
tags:                  

MobileMe vs. Live Mesh Throwdown - Round 1

Wed 16 Jul 08 10:33 A GMT-05

Building Model Classes in C# and Cocoa

Sun 15 Jun 08 3:13 P GMT-05
tags:            

MobileMe vs. Live Mesh - Round 1

Wed 11 Jun 08 12:20 A GMT-05

My Macbook Air is masculine, dammit!

Mon 17 Mar 08 6:59 P GMT-05
tags:          

iPhone Underrated as a Gaming Device?

Fri 14 Mar 08 1:50 P GMT-05
tags:        

My take on the iPhone SDK

Sat 08 Mar 08 1:39 P GMT-05

Jobs says "not likely" to Flash on the iPhone

Thu 06 Mar 08 1:39 A GMT-05
tags:          

My Macbook Air Review

Sun 02 Mar 08 4:20 P GMT-05

iPhone Roadmap March 6th

Fri 29 Feb 08 10:41 P GMT-05
tags:        

Video of the Macbook Air in Action

Wed 20 Feb 08 3:04 P GMT-05

Macbook Airはきれいですよ!

Sun 17 Feb 08 2:38 A GMT-05

Why is O'Reilly Condoning iPhone Hacking?

Mon 11 Feb 08 3:55 P GMT-05

Evaluating my next laptop purchase

Wed 06 Feb 08 8:40 P GMT-05

The iPhone SDK key has been leaked! Oh Noez!!!1

Tue 29 Jan 08 11:36 A GMT-05
tags:        

Why Geeks just don't "get" the Macbook Air

Thu 17 Jan 08 2:30 P GMT-05

Popcorn + TiVo + Macbook Pro + iPhone == Hell Yeah!

Tue 15 Jan 08 3:11 P GMT-05
tags:          

How my ADC membership changed my life

Mon 31 Dec 07 3:57 P GMT-05
tags:      

LINQ to REST - A much better name for Astoria

Tue 11 Dec 07 1:23 P GMT-05
tags:        

Leopard Code Sample : Sprinkling in some Bonjour

Tue 27 Nov 07 2:32 P GMT-05
tags:        

Leopard Sample: A Bound NSCollectionView

Mon 29 Oct 07 1:41 A GMT-05

Leopard is out - let the code samples begin!

Fri 26 Oct 07 10:09 A GMT-05
tags:          

My life is complete : iPhone SDK is CONFIRMED.

Wed 17 Oct 07 6:38 P GMT-05
tags:          

Leopard Shipping October 26th!!

Tue 16 Oct 07 4:59 P GMT-05
tags:        

My iPhone Review

Mon 23 Jul 07 1:09 P GMT-05
tags:        

Microsoft Codename Acropolis - Unwrapped

Wed 20 Jun 07 3:22 P GMT-05
tags:              

The dreaded language bleed-over has begun

Tue 19 Jun 07 6:23 P GMT-05
tags:        

Exploring the Delegate Design Pattern

Mon 14 May 07 6:30 P GMT-05

Core Data - Almost too Easy?

Wed 18 Apr 07 2:23 P GMT-05

Exploring the MVC Pattern in WPF

Tue 10 Apr 07 12:51 P GMT-05
tags:                      

An experience with the Leopard beta

Mon 26 Mar 07 7:45 P GMT-05
tags: