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.

Figure 24-3. Core Data modeling in Xcode<br />

Of course, Core Data is best known for persistence. When the user clicks the Save button,<br />

you’ve got to decide if that data is going to be written out in some binary format, converted to<br />

human-readable XML, or stored in a relational database. Each has its advantages and disadvantages,<br />

but choose wisely, for once you pick a persistence model, you’re stuck with it.<br />

Well, that’s not entirely true. Nothing is going to stop you from throwing out your XML<br />

code and rewriting the whole thing to use relational database. Nothing, that is, except time,<br />

money, and a tremendous amount of wasted effort.<br />

With Core Data, changing your persistence model is as simple as changing your mind. You<br />

haven’t written any code to read and write data, nor to communicate with any database. Core<br />

Data handles all that dirty business for you, so if you want to develop with easily debugged<br />

XML, and then switch to a database for performance, you can.<br />

And if you do decide to use a database, you don’t have to worry about installing a database<br />

management system onto your users’ machines, because all that stuff is already built into<br />

<strong>Mac</strong> <strong>OS</strong> X. Oh yeah, and you don’t have to write, think in, or even be aware of the existence<br />

of SQL.<br />

Image Kit<br />

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

Sometimes an application’s functionality becomes so beloved that it finds itself being copied, in<br />

whole or in part, in all kinds of other places. Consider photo management, once synonymous<br />

with iPhoto. Now you can take pictures in iChat, apply filters in Photo Booth, and view<br />

slideshows in Mail.<br />

When this happens, Apple may factor out that functionality into a “kit” framework. Think<br />

of it as an application without an interface that you can embed into your own application. With<br />

<strong>Leopard</strong>’s new Image Kit, you can embed all the photo management functionality of iPhoto in<br />

your own application, as shown in Figure 24-4.

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

Saved successfully!

Ooh no, something went wrong!