Ownership of user created content.

I want to implement some concept of ownership/authorship in Chef’s Book.  Not for any reason of control but as a way of letting users swap recipes without data loss or unnecessary duplicates.  The problem is if I email a recipe to myself and load it on the iPad I get a new recipe.  That was fine for launch but now I want to keep the iPad copy up to date with changes I make on the iPhone (it has the camera!) so I don’t want duplicates.  That’s easy.. if the recipe exists on my iPad replace it.  That’s fine, and that’s what will happen, but what if I’ve sent it to Bob and Bob has made changes?  Bob would be pissed if he lost them when I sent him a new version with more milk and less photos.

To solve this each user needs to be identified and thus if Bob makes changes to a recipe he’s got then he becomes the owner of that recipe, in fact it becomes a new recipe.  This way if I send an updated version of my recipe to Bob he’ll get it as a new recipe, if Bob doesn’t make changes then his recipe will be updated if necessary.

So far, so simple.  Any change to a recipe that you do not own will make you the owner and generate a new unique identifier.  Any change to the title of a recipe you own will also generate a new unique identifier such that I can make chocolate cake and send it out, edit the dish to become a spanish omelette and send that out too.  Peoples chocolate cakes won’t change into spanish omelettes overnight then.

Good good… what about if I edit the recipe on my iPad and send it back to the iPhone?  Ah.. without a centralised system my iPad will grab ownership of the recipe after changes and make it a new recipe, sending it back to the iPhone will therefore import it anew.  That’s also fine, but not ideal.

Such centralised behaviour is something I want to do but it wasn’t something I planned to have to do with this update.  It was something that would be necessary for uploading recipes to a server for others to search and download.  It would allow them to receive updates to recipes they have downloaded but not altered.  Of course that behaviour isn’t cast in stone, I would probably store the ID’s of downloaded recipes against the users profile to notify them of updates.  That allows for some flexibility too, users can modify recipes to their hearts content and yet still get poked if a new version is available.  Which would then download as a fresh copy.

So one part of me has had a flippant and amusing idea.  If it’s possible to grab some unique info back from Game Center would that be a good thing to implement?  It’s not a game so how intrusive would it be?  If I felt truly silly I could bung in some achievements too.  Part of me wants to do that just because it’s daft and amusing.

It has to be practical though.  So I’ll have to check on a few things:

  • Is there an ID I can safely store from game center.
  • Do Apple mind if it’s used for non gaming applications?  I know of a To Do list dressed up as a game that uses it.
  • How unobtrusive can it be made?

Of course the ideal solution is to code something quickly that just provides the basics of authentication using OpenID.  That would get the foundations laid for the future which needs to be done anyway and would not exclude any flippant future use of game center.

Whilst I ponder this I’ll just implement the flow I’ve got so I can test it extensively.  One thing I want to check is the speed with which I can do a deep comparison of a large recipe incoming as a chefdoc with a present recipe NSManagedObject hierarchy.  I want to know how long it would take to determine whether even an image in a recipe has been modified.  For example someone taking an existing received recipe and updating it with their own photos.

This entry was posted in Chef's Book, Programming and tagged , , . Bookmark the permalink.