Browse Prior Art Database

Ensuring Internal Consistency in a Set of Interconnected Classes

IP.com Disclosure Number: IPCOM000111520D
Original Publication Date: 1994-Feb-01
Included in the Prior Art Database: 2005-Mar-26
Document File: 2 page(s) / 81K

Publishing Venue

IBM

Related People

Hlava, A: AUTHOR

Abstract

Disclosed is a method for ensuring internal consistency in a set of interconnected classes. Often times a closely related group of classes in an object-oriented application will contain many pointers between object instances. The problem arises of how to keep these pointers from becoming invalid as objects are created, moved and destroyed.

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

Ensuring Internal Consistency in a Set of Interconnected Classes

      Disclosed is a method for ensuring internal consistency in a
set of interconnected classes.  Often times a closely related group
of classes in an object-oriented application will contain many
pointers between object instances.  The problem arises of how to keep
these pointers from becoming invalid as objects are created, moved
and destroyed.

      This disclosure defines a class and associated methods which
can be used to ensure internal consistency within a group of
interconnected objects.  In this invention, "internal consistency" is
defined as the state of a group of objects where all inter-object
pointers are pointing to a valid object or are set to null.  In other
words, there are no "dangling pointers" to objects which have since
been deleted or moved.

      This disclosure defines a "PointerSet" class, its associated
methods, which must be present in the cooperating classes, and the
algorithm for how these all work together to ensure internal
consistency within the group of classes.

      The Figure illustrates how some objects might be interconnected
via pointers, and how the PointerSet class is used to track
inter-object pointers.

      In this example, there is a list of three objects (A, B, and C)
which are connected by "next" pointers.  There is a base list object
(LIST) which points to the top of the list.  There is also an
iterator object (ITER) used to step through the list.

      In such an object group deleting or moving an object will
normally result in one or more dangling pointers (pointer in one
object which points to another object that no longer exists).  In
order to maintain internal consistency in the object group, the
PointerSet class is used.

The key features of the method defined here are:

o   A new object class (PointerSet) is introduced to help manage
    inter-object pointers.  It maintains a table containing a
    use-count, pointer holder, and pointer target (represented by the
    three columns in the diagram).  Each entry in the table
    represents a "holder/target pair": an object (holder) which has a
    pointer to another object (target) in the object group.  The
    use-count is needed because holders may have multiple pointer...