Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > iTunes & iPhoto - HOW?

iTunes & iPhoto - HOW?
Thread Tools
Forum Regular
Join Date: Oct 1999
Location: Baltimore, MD
Status: Offline
Reply With Quote
Feb 26, 2002, 06:52 AM
 
How do iTunes and iPhoto keep track of all their items and do it so well? Is this just a big array or do they use some sort of database mechanism? I posted this a few months ago and no one really helped so I thought I'd try it one more time. I'm just curious ...

I'm assuming they just store everything in a big array since you won't have more than a few thousand items ...?
     
Forum Regular
Join Date: Jan 2001
Location: Boston, MA
Status: Offline
Reply With Quote
Feb 26, 2002, 03:40 PM
 
Originally posted by ruttopia:
<STRONG>How do iTunes and iPhoto keep track of all their items and do it so well? Is this just a big array or do they use some sort of database mechanism? I posted this a few months ago and no one really helped so I thought I'd try it one more time. I'm just curious ...

I'm assuming they just store everything in a big array since you won't have more than a few thousand items ...?</STRONG>
I don't pretend to know anything about the internals of either app, but I suspect that the backing store is a little more complex than an array, but very similar conceptually. If you notice one thing about the way both apps store things, it's that they only have one level of embedding. That is, in iTunes you can't create a playlist in a playlist. So the data structure there probably isn't a tree, but maybe a big dictionary or something like it. iTunes and iPhoto only let you do sorting, there's no database-like querying available.

I'm sure each object, like a song or photo, is some custom class and then there are other, higher-level container classes (like Playlist or PhotoAlbum) which know how to represent their contents in a flexible manner. In Cocoa, it's pretty easy to write out representations of complex classes to disk (serialization), but it's not as easy in Carbon (since it's a straight C interface).

Since one is written in Carbon and C++ and the other in Cocoa and Objective C, the structures they use are probably very different, but the concepts are pretty similar.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:10 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2