karelia / BSManagedDocument

Brings UIManagedDocument's design to OS X
Other
55 stars 25 forks source link

Add support for Automatic Migrations #9

Closed Abizern closed 7 years ago

Abizern commented 11 years ago

This has been tested, but I don't want to create a pull request until you create a branch called tests.

mikeabdullah commented 11 years ago

I don't want to create a pull request until you create a branch called tests.

Voila, one tests branch.

mikeabdullah commented 11 years ago

I'm still struggling to decide if I actually want to have this baked in as a feature. In the meantime, have made some changes on my automatic-migration branch which hopefully you're happy to pull back into yours

Abizern commented 11 years ago

Nice, thanks.

mikeabdullah commented 11 years ago

So I guess my big issue is that this is only really useful during initial development of an app. Once you start shipping to real customers, it seems rather rude to silently upgrade documents upon simply opening them. Instead you want some sort of UI prompt, or to defer the migration until first save, I think.

Come to think of it, I wonder what happens when combined with Versions. Documents opened from browsing through Versions are read-only so migration would be impossible. I wonder if Core Data ignores the request though, or fails with an error.

It seems to me it would be better just to whack a snippet of code into the README that devs can quickly paste into their BSManagedDocument-subclass in order to switch on automatic migration. How about you?

Abizern commented 11 years ago

I see your point.

You have more experience that I about creating general use frameworks - so I see your point. My current use case is because I'm in development, I I just want to be able to migrate my documents without worrying about them. So currently this works for me.

That said - I think there should be some built in support for migrations. Maybe even a delegate protocol that can be queried when a the model changes.

mikeabdullah commented 11 years ago

Maybe even a delegate protocol that can be queried when a the model changes.

I'm confused. You'd set up some custom object as the document's delegate? That seems freaky. Or something else?

Abizern commented 11 years ago

I was thinking out loud.

I have an idea. If it works I'll push it for comment.

Abizer

On 28 Jan 2013, at 17:43, Mike Abdullah notifications@github.com wrote:

Maybe even a delegate protocol that can be queried when a the model changes.

I'm confused. You'd set up some custom object as the document's delegate? That seems freaky. Or something else?

— Reply to this email directly or view it on GitHub.