In Windows Vista, you'll be able to register property handlers on your own file types. This is in fact what my PDC Talk was all about. These property handlers are used to expose your file's contents to other parts of the system. They use a standard schema to enable stacking, grouping, filtering, and other metadata-search operations across heterogeneously typed items. The Universal Search Engine will for example call the registered property handlers to enumerate all the properties on each file during indexing. So, indeed, the most important feature that a registered property handler provides is metadata reading. In this sense, the interface for property handlers, IPropertyStore, is a simplified version of IFilter.

But property handlers provide another important feature. They allow the system to write metadata to your file types. Although this introduces extra complexity for the file type designer, it enables many cool end-user features. For example, a user doesn't have to start up the file's associated application in order to change the Author property. Instead, the user can simply select the item from within Explorer and drag it into a different Author stack. Or, just type in the name of the new Author into the preview pane.

Property handlers which support open metadata can reason over properties which aren't intrinsic to the underlying file type. These handlers can accept any value for any property, persist that value, and then return the same value later. And by "any property", I include those properties whose schema is invented after the property hander is written. Quite a trick!

Of course, the platform provides serialization APIs and other services to make it easier to support open metadata (the IPropertyStoreCache implementation returned by SHCreatePropertyStoreOnMemory supports IPersistStream), but usually adding this support to your file format carries some nonzero cost. So why do it? Supporting Open Metadata means that users can organize their files of your type along dimensions that you may not have anticipated. This is a very powerful idea! Here are some example scenarios that come to mind:

  • The "rating" property in Windows Vista isn't intrinsically supported by most file formats, but it's a cool feature to be able to rate your Visio documents, for example, and then sort or group them by rating.
  • Imagine an IT manager at a law firm who deploys the "legal case number" and "client name" schema elements onto that firm's computers. The lawyers at the firm will be able to within Explorer (or the Common Item Dialog) assign case numbers and client names to the various documents associated with that case. This could include not only word processing and spreadsheet documents, but other file types like faxes and media files which represent, say, evidence or recordings of hearings.

    The IT manager could then get fancy by creating and deploying custom Virtual Folders which perform interesting queries like:

    Stack all my documents by their associated legal case number, then group those stacks by client name.
    That IT manager will look like a super-star!
  • Imagine being able to attach a "priority" property to documents, like you can for messages in Outlook. Then you could quickly filter your documents based on their priority.
Open Metadata allows users to enable custom search and organize scenarios across heterogeneous sets of items.