Re: Building a tree class with *multiple* parents

From: Tom Plunket <tomas_at_fancy.org>
Date: Thu, 15 Feb 2001 14:11:29 -0800
Message-ID: <isko8t856h55bvng4uapuj2a18mc0as63k_at_4ax.com>


  1. Melon wrote:

> Think of a Bill-Of-Materials database. The factory builds many assemblies,
> some of which are top assemblies (these would be the root nodes) and the
> rest are subassemblies. Here's the tricky part - a subassembly can be used
> in more than one parent assembly. So these are the branches. Components
> are represented by nodes with no children - these are the leaves.

I'd suggest that it may be easier to put together if you consider the components "base" objects, and then any assembly of components would be a list of the base objects...

oh- but you needed to be able to traverse the structure in both directions? If so, I guess I'm not giving any interesting info. However, if you, say, have a "car" you could see what the next-level subassemblies are trivially, although there would be no link between "bolt" and all of the assemblies that it appeared in...

-tom!

-- 
Tom Plunket                                            tomas_at_fancy.org
PlayStation2/3D Studio geek
              The best tagline is the one that you steal.
Received on Thu Feb 15 2001 - 23:11:29 CET

Original text of this message