Ziff-Davis Enterprise 
DevSource: Microsoft Developer Resource
Add OnsArchitectureLanguagesTechniquesUsing VSForums
 
Home arrow Techniques arrow Page 3 - A Developer's Introduction to Microformats
A Developer's Introduction to Microformats
By Phil Haack

Rate This Article:
Add This Article To:
A Developer's Introduction to Microformats - ' Core Principles '
( Page 3 of 4 )

Core Microformat Principles

The XFN example above demonstrates one of the core principles of microformat design: building upon prior work. This is one of the six core principles listed on the Microformat Web site:

  1. Solve a specific problem.
  2. Start as simple as possible.
  3. Design for humans first, machines second.
  4. Reuse building blocks from widely adopted standards.
  5. Modularity / embeddability.
  6. Enable and encourage decentralized development, content services.
Solve a specific problem: Your natural inclination may be to pick up the new microformats hammer and see all types of data as nails waiting to be hammered. You might consider using a microformat to categorize Star Trek alien species. But before doing so, the microformat designer should consider what problem he is trying to solve.

ADVERTISEMENT

In the previous XFN sample, your problem might be “How do I express my relationship to the person or site to which I am linking?” The reasons to solve this problem are many, one of which may be that the author wants to make sure readers understand which sites she is endorsing and which she is not.

Start as simple as possible: Rather than attacking a complex problem head on, look for a simpler problem to solve and start there. Over time, as microformat designers solve the simple problems, they can build on their solutions to solve more complex problems. Keeping microformats simple helps to spur adoption as people are often intimidated by overly complex formats.

Design for humans first, machines second: Designing for humans first require that microformats must be more than just parsable. They must also be presentable. Microformats reduce redundancy caused by having one page (such as a blog Web page) with the content for humans to read, and a separate file (such as an RSS feed) specifically for machines.

Let’s linger on that last point for a moment. RSS is designed to be parsable, so it can be easily read by machines. Users subscribe to an RSS feed using an RSS aggregator, which then parses and formats the information in the feed in a displayable manner. RSS feeds are not intended to be read directly in a Web browser (though some Web authors do provide an XSLT stylesheet and a CSS file that transform an RSS feed into a human readable form).

In contrast, microformats are embedded in the content itself, so that a separate feed is unecessary. Microformats are also intended to be easy to write. This promotes adoption by content producers in much the same way that HTML has seen widespread adoption.

Reuse building blocks from widely adopted standards: Microformat designers make every effort to reuse building blocks from widely adopted standards. By looking at existing usage patterns and existing formats, microformat creators avoid reinventing the wheel and leverage the work of others. This technique of looking at existing work is referred to as paving the cowpaths.

Paving the cowpaths is illustrated by looking at the history of creating web content. Over time, there has been a general movement in the web community away from embedding style information within HTML markup. As CSS-based design steadily grew, HTML authors attempted to keep presentation separate from content. Naturally, many authors started using the class attributes to add semantic information to elements as opposed to style information.

The creators of microformats observed this behavior and attempted to codify and categorize this existing behavior into a dictionary of XHMTL formats. Not every format is taken from existing patterns within HTML. The hCard format, for example, is a one-to-one representation of the vCard standard (RFC2426).

Rather than attempt to create a whole new format for describing contacts, the hCard creators chose to focus on mapping an existing and widely used format into XHTML.

Modularity: In general, the term modularity refers to the property of a system in which individual parts can be viewed, separated, and modified independent of the entire system. In a modular system, these individual parts fit cleanly together.

Microformats are designed with this principle in mind. By ensuring that microformats do not contain unecessary dependencies on external resources (such as the URL of the hosting page or other content in the page), content producers can easily embed microformats in any content.

This modular approach also makes it easy to compose microformats together to create other microformats. This ability to embed one microformat in another is a powerful technique for building new microformats.

Enable and encourage decentralized development, content services: By basing microformats on simple conventions, as opposed to strict schemas, microformats can be developed in a decentralized manner. There is no single repository or authority for microformats.

This allows publishers to create microformats that may meet niche needs. For example, stamp collectors might build a microformat for sharing information about collected stamps.



 
 
>>> More Techniques Articles          >>> More By Phil Haack
 



DevSource video
Devsource Video Series
Manipulating Society through Technology
Jeremy Bailenson, Director of the Virtual Human Interaction Lab at Stanford University, talks about virtual reality, avatars, Moore's law, how real world behaviors influence online reality, and societal manipulation through technology!
>> Play video
>> Read article
>> See all videos
DevLife Blog

Julia explores the Robotics Studio! (It's for more than you think.)

MSDev Blog

Messages for Bill Gates!

Make it Work
.NET makes runtime type checking a breeze. See what Peter has to say about it in this week's tips!
News
Microsoft Counts on App Support for Vista
Microsoft has taken pains to demonstrate that Windows Vista will have ample application support.
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.