Monday, February 2, 2009

SQLitePersistentObjects Update

For some of my client work, I needed to have the ability to have objects reference each other when using SQLitePersistentObjects. Unfortunately, when either object was saved in this case, it would create an infinite loop.

As a result, I implemented a feature sooner than I had thought I'd get to it. Persistent objects now use KVO to determine when objects change, and when they change, the object is marked as "dirty". Only dirty objects get saved - if you call "save" on an object that's not dirty, it will result in a no-op. This should be a performance gain even for people who don't need the ability to let objects refer to each other.



4 comments:

Darren Minifie said...

Hey cool!

I was under the impression that KVO wasn't implemented on the iPhone the same way it is in OSX. I'm fairly new to the platform, but one feature I really like about MacOS is that you can bind a UI widget to some value. Maybe I'm confusing terms here but having the ability to bind would be fantastic on the iphone

Jeff LaMarche said...

KVO is available on the iPhone, but bindings aren't. KVO and bindings aren't the same thing - bindings rely on KVO, but KVO exists without bindings. Without bindings, KVO is 'opt-in" - in that you must register as an observer of a keypath. SQLitePersistentObjects automatically register themselves as observers of their own properties and mark the dirty flag when notified of a change.

CHEAPSOCCERUNIFORM said...

I am so excited about this page. Thanks for the wonderful post .I bookmarked this site for further reading.
Now it will be very cold in winter, in order to keep warm yourself, moncler company has provide jackets for you, so it is better to own moncler jackets yourselif as soon as possible. Eeveryone love fashion clothing, polo ralph lauren is very popular all over world, that is my dream to get ralph lauren.We know Ray Ban by America soldier, all of them wear ray ban sunglasses when they walk on the road, it is fashionable for you. Most of people like to wear jeans, it is very modern when wearing true religion jeans in the street.

h4ns said...

I was very encouraged to find this site. I wanted to thank you for this special read. I definitely savored every little bit of it and I have you bookmarked to check out new stuff you post.

AC Milan vs Lazio Live Streaming
West Bromwich Albion vs Wigan Athletic Live Streaming
Manchester United vs Aston Villa Live Streaming
Sunderland vs Chelsea Live Streaming
Arsenal vs Everton Live Streaming
Augsburg vs Bochum Live Streaming
Racing Santander vs Valencia Live Streaming
Frosinone vs Atalanta Live Streaming
AC Milan vs Lazio Live Streaming
West Bromwich Albion vs Wigan Athletic Live Streaming
Manchester United vs Aston Villa Live Streaming
Sunderland vs Chelsea Live Streaming
Arsenal vs Everton Live Streaming
Augsburg vs Bochum Live Streaming
Racing Santander vs Valencia Live Streaming
Frosinone vs Atalanta Live Streaming
Technology News | Hot News Today | Live Stream