Browse Prior Art Database

Demand Load Nodes

IP.com Disclosure Number: IPCOM000111877D
Original Publication Date: 1994-Apr-01
Included in the Prior Art Database: 2005-Mar-26
Document File: 4 page(s) / 70K

Publishing Venue

IBM

Related People

Redpath, RJ: AUTHOR

Abstract

This design details a process for enabling demand load subtrees for data from a database. For some GUI systems, predefined controls are available for the construction of hierarchy data as a tree. The trees are defined as directed graphs so as to enable the user to keyboard traverse in addition to mouse traversal. The inherent problem with this control is that to enable a node to indicate that it has children, the children must be loaded. The current solution is to load the children of a node in a breadth first fashion, so as to avoid having to load the complete hierarchy below a node. When a node is presented to a user, the children are already preloaded, though the children nodes are not preloaded. A breadth first design is unacceptable for a database when child node data for a node can be quite large (4000 nodes).

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Demand Load Nodes

      This design details a process for enabling demand load subtrees
for data from a database.  For some GUI systems, predefined controls
are available for the construction of hierarchy data as a tree.  The
trees are defined as directed graphs so as to enable the user to
keyboard traverse in addition to mouse traversal.  The inherent
problem with this control is that to enable a node to indicate that
it has children, the children must be loaded.  The current solution
is to load the children of a node in a breadth first fashion, so as
to avoid having to load the complete hierarchy below a node.  When a
node is presented to a user, the children are already preloaded,
though the children nodes are not preloaded.  A breadth first design
is unacceptable for a database when child node data for a node can be
quite large (4000 nodes).

      The process is the following.  Two methods are created, called
hdn() and checkflags() shown below, which will enable demand loaded
nodes.  The design was created in this manner so as to uncomplicate
the normal process of inserting nodes to build a hierarchy.

class node{
     public:
        node(void);
        node(char *title);
        ~node(void);
        short          checkflags(short flag);
        void           hdn(short flag);
        node *         append(node *child);
        node &operator +=(node &right);
        node &operator +(node &right);
     private:
         unsigned  _flags;
    };

/*******************************************
   * hdn:
   *    Has Dummy Node, 0 will remove it and 1
   *    will add one
   ********************************************/

void node::hdn(short flag)
   {WidgetList list;
   int        i,num;

 if (flag){
       this->append (new node(""));
       this->_flags|=FLGEXPANDABLE;
       return;
      }

 if (num=XmContainerGetItemChildren((Widget)_container,
                                      (Widget)_w,
                            ...