About | ACP | Buy | Forum | Industry Watch | Learning Curve | Search | Twitter | Xnews
Home » Learning Curve » Developers Workshop

More on Services

That thing from NeXT. Aka system services. Aka Cocoa services. Through the glass giddily.


Buy It

Try It

Cocoa services, aka system services: they're a great invention. The concept is simple but brilliant. Communicate via an impartial intermediary. The intermediary knows what the client wants and what the server offers. Data is exchanged with the intermediary and pasted back to the client. That's it.

The original services were better. But no one used them. Maccies expected context menus and didn't know you could add keyboard shortcuts to services.

Some developers thought it was really cool with services, but wrote modules with essentially the same code over and over again to perform essentially the same task.

That wasn't particularly smart.

<dict>
    <key>NSMenuItem</key>
    <dict>
        <key>default</key>
        <string>AWS Amazon</string>
    </dict>
    <key>NSMessage</key>
    <string>aws</string>
    <key>NSPortName</key>
    <string>AWS</string>
    <key>NSSendTypes</key>
    <array>
        <string>NSStringPboardType</string>
    </array>
    <key>NSUserData</key>
    <string>amazon.com/exec/obidos/search-handle-url/field-keywords=</string>
</dict>

At some point in the mists of time, Apple fucked up. They made services run by root code. Code like that can of course break a system, and the NeXT engineers knew that. But the NeXT engineers didn't do it - Apple's finest did. And so began the clampdown on services. Services had been hierarchical up to but not including 10.6; suddenly they were dumbed down (but oh so pretty). For there are those who so put form over function that they can't even spell it.



(Caveat: NSReturnTypes and NSSendTypes should definitely still be used - weird things may otherwise happen.)

There's of course another ginormous caveat with the above: hierarchical menus don't threaten to run off screen, but these supposedly 'improved' (dumbed down) menus do. Oops.

Starting with 10.5, paranoia crept into Cupertino. Former head developers were moved over to the iPhone project and all bets were off. Code was reorganised (and seldom for the better) and important functionality was sabotaged. Modified stamps were checked hysterically, and at the least sign of something out of the ordinary, the whole system was shut down. Needless to say, this made it extremely difficult for developers and users both.

There's no reason to limit hierarchy to two levels, but the NeXT engineers did. Services crept into the OS X reincarnation of OPENSTEP that started seeing the light of day in 2002, five years after the 'merger'.

Then along came Watson, then along came Apple's countermove Sherlock, then along came Konfabulator, then along came Apple's countermove Dashboard. All these apps went to extreme lengths to 'scrape' incoming HTML (which can be read in a browser) and gussy it up, in what they would have argued was a 'prettier' format.

Of course everything was 'baked into place' - things couldn't be adjusted by users after the fact. Not only in terms of what services were available, but also in terms of how they worked. Change one byte on a remote server and the whole thing could come crashing down.

Apple keep adding things to context menus, sometimes getting it right, sometimes getting it upside-down.

Rixstep & Cocoa Services

The potential of these services was apparent from Day One. And a lot was written about them.

Here's an obtuse tutorial from 2009, when services still had hierarchy. It tries a technical explanation. (That might not have been a good idea.)

'Baker Street Blues' dates from July 2004. It's a treatise on the war back then between Dan Wood's Watson and Apple's countermove Sherlock - and on their common inherent weaknesses.

This Q&A looks again into the simple mechanics of an AWS query string. The point, once again, is that companies change their search mechanics all the time - and you can't wait for a software or OS update to get things running again. (And most likely you won't want to a wait for a 'bug fix' that may never arrive.)

Any search at this site will turn up more articles than you can shake a stick at, much less want to read. The point is that AWS web services are simple: one code loop and it's a done deal - nothing like those old kernel extensions.

Postscript: AWS & Gatekeeper

Gatekeeper can interfere with the ACP Web Services, so check your System Preferences. And when you're at loose ends: ask yourself who profits from a 'protection system' that can be so eminently hacked.

See Also
Red Hat Diaries: Apple's Mistake
Learning Curve: The Key to Gatekeeper
Developers Workshop: Hacking C0d3 S1gN
Learning Curve: That 'Unknown' Feature in OS X

Red Hat Diaries: The Steve Gambit

Industry Watch: Mac Developer Program Update
Industry Watch: Mac Developer Program Update II

Learning Curve: Odd Corruption Launch Error 10.9.4
Industry Watch: Steve Jobs to App Store for Mac: 'Nope'
Industry Watch: Apple Recipient of Not So Coveted Big Brother Award

About | ACP | Buy | Forum | Industry Watch | Learning Curve | Search | Twitter | Xnews
Copyright © Rixstep. All rights reserved.