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.

No comments:

Post a Comment