• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Pattern for plugins, archiving, and dynamic document data model?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pattern for plugins, archiving, and dynamic document data model?


  • Subject: Pattern for plugins, archiving, and dynamic document data model?
  • From: "l.m.orchard" <email@hidden>
  • Date: Thu, 30 Aug 2001 09:58:17 -0400

Okay, hopefully this makes sense. I am working on an outline editor which supports plugins. The model is basically a tree, with arbitrary data hung off the tree nodes. Out of the box, the outline editor has a title and notes hung off each tree node.

Now, I want to allow plugins to introduce new classes of data to hang off each node. For instance, I want to write a to-do item plugin which adds things like completion progress, task due date, hours anticipated, etc. This plugin would supply a new model class for the data, and a new panel to add to the outline item inspector.

The big wrinkle I have in all of this is that, if someone does not have the plugin, I would like the saved document to still be handled gracefully. That is, you will see the title and notes if you do not have the to-do item plugin, and when you save, the original to-do item data will be preserved (if possible). I think I can do the first, but I'm not sure about the second.

What I have in mind is to store all the extended data in a dictionary of dictionaries. The first level of the dictionary will be keyed on outline tree node objects, and the second will be keyed on the plugin identifier. So, this is maintaining the extended data objects separately from the main document tree. Then, when I save, I will archive the document tree first, and then the extension dictionary.

I'm hoping that this will allow some sane handling of the documents when the plugins are not present. Am I crazy with this idea, or...?

--
Leslie Michael Orchard <email@hidden>
ICQ: 492905 (home) 11082089 (work)
"...see you space cowboy..."


  • Follow-Ups:
    • Re: Pattern for plugins, archiving, and dynamic document data model?
      • From: "Erik M. Buck" <email@hidden>
  • Prev by Date: RE: Return and Enter keys in NSTextView
  • Next by Date: NSCursor and 1 bit mask ?
  • Previous by thread: Re: Subject: Inherited constructors
  • Next by thread: Re: Pattern for plugins, archiving, and dynamic document data model?
  • Index(es):
    • Date
    • Thread