To tell you the truth, my advice is to fight the requirement for multiple parentage. I've worked on a number of projects that mapped complex hierarchies, and this multiple parents idea seems to come up a lot. It's usually a red herring. It looks like it will solve a certain problem, but in the end it hopelessly confuses users and dramatically complicates code.

People often think this is the way to handle cross-linked hierarchies. I think what Yahoo does makes more sense, essentially having symlinks to the other nodes rather than a standard parent-child relationship. Having multiple parents means you can never know your context (for something like a breadcrumb trail back up to the root node) without keeping a complete history of every node a user has visited on the way to this one.

The last time I had a problem like this was at an e-commerce site (see if you can guess which one) where we were trying to deal with the fact that a section like "new Pokemon junk" might need to show up under multiple areas in the store and the merchants controlling it don't want to keep track of that and double enter it. An obvious requirement for multiple parentage, but I saw all kinds of implementation problems with it. After trying various things, I ended up making two trees, one for concepts like "new Pokemon junk" with products attached, and one for site layout. The nodes on the concept tree were mapped many to many onto nodes of the layout tree. It sounds complex, but it was less confusing than multiple parentage and it was plenty fast in oracle.


In reply to Hierarchies and multiple parentage by perrin
in thread Representing the result of a node search in HTML by merlyn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.