05.01.2013 Views

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

430<br />

CHAPTER 24 MAC <strong>OS</strong> X DEVELOPMENT: THE APPLICATION FRAMEWORKS<br />

NOTE For more information on Automator and automation, see Chapter 23.<br />

Dot<strong>Mac</strong> Kit<br />

To those of us who’ve been online since the first IP addresses crawled out of the sea, the services<br />

of Apple’s .<strong>Mac</strong> subscription service are nothing new. E-mail, a home page, and a little space on<br />

a server somewhere are old hat. Still, .<strong>Mac</strong> manages to remain compelling, not with what it does,<br />

but how.<br />

Normally, publishing things to the Web involves several steps and specialized file transfer<br />

programs. Using the WebDAV standard, the Dot<strong>Mac</strong> Kit embeds web services directly into applications.<br />

A user’s .<strong>Mac</strong> account becomes less like a server and more like an online extension of<br />

their home folder.<br />

Integrating with .<strong>Mac</strong> is a great way to add value for your users, and is probably the<br />

number-one feature that sets applications designed “for the <strong>Mac</strong>” apart from applications that<br />

are “<strong>Mac</strong> compatible.” Fortunately, the Dot<strong>Mac</strong> Kit, also known as the .<strong>Mac</strong> SDK, makes<br />

adding this feature almost as easy as using .<strong>Mac</strong> itself.<br />

The Dot<strong>Mac</strong> Kit breaks all operations into transactions. This means checking credentials,<br />

making sure a user’s account is current, creating a directory, and moving files to and from the<br />

server are all encapsulated as transactions.<br />

Transactions allow you to switch between synchronous and asynchronous modes as needed.<br />

There are a few places where switching modes is handy, but it’s absolutely indispensable for<br />

debugging. There’s also a compatibility interface for the truly lazy, which mimics the methods<br />

used by Cocoa’s NSFileManager class. It doesn’t have the same flexibility as transactions, but for<br />

simple actions or quick prototyping, it’s quite convenient.<br />

Calendar Store<br />

As Address Book does for people, iCal does for events. Aside from the standard questions<br />

(What’s going on? Where? When? Who’s going to be there?), iCal events can include things like<br />

URLs, notes, and alarms: time-sensitive triggers that can do anything from popping up a<br />

reminder, running a script, and sending an e-mail. Using a colorful, easy-to-understand interface,<br />

iCal lets users manage all their calendar-related information in one place, as shown in Figure 24-8.<br />

Again, just like with Address Book, your application can interact with iCal’s data using the<br />

Calendar Store framework. New in <strong>Leopard</strong>, Calendar Store frees your application (not to mention<br />

your users) from the tedium of dealing with the same information in multiple places.<br />

Calendar Store does more than just accessing, editing, and creating events. It also does the<br />

following:<br />

• Manages <strong>Leopard</strong>’s system-wide To Do list<br />

• Notifies interested applications of any changes to the calendars<br />

• Provides fast, flexible data-mining services using predicates: high-level, object-oriented<br />

queries used throughout <strong>Mac</strong> <strong>OS</strong> X<br />

In fact, it’s better to think of Calendar Store as what it really is: a central database. iCal just<br />

happens to be a conveniently prebundled client. Indeed, Calendar Store is based on CalDAV, an<br />

open networking standard that lets your users connect with server-side collaboration software,<br />

regardless of platform.<br />

It also means your applications calendaring features need no longer bind users to iCal. Any<br />

application can use Calendar Store. In fact, <strong>Leopard</strong> provides several examples of this kind of<br />

integration. The next time you get a piece of e-mail asking if you’re coming to the party on<br />

Wednesday, try clicking the text and watch iCal add that event, as if your host had sent you an<br />

iCal invitation.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!