Recursion

A pattern to indicate that an object of a particular class may be comprised of, or contain, an object of that same class.

One way to express recursion is through hierarchical inclusion. For instance, in an XML schema, a content model for an element of a given type might include the same element. While this approach is straight-forward and may have advantages in accurately representing the object, it often poses implementation problems.

The alternative to expressing recursion through hierarchical inclusion is to express the recursive relationship by having each child node reference the unique identifier of it parent. Where this pattern is used, a "parent identifier" (ParentID) is included as part of the content model of "recursive" elements.

For additional information and variations on recursive patterns, see: (Universal Patterns for Data Modeling), by Len Silverston and Paul Agnew.