Browse Prior Art Database

Mechanism to Collect a Set of Homogeneous Objects of Unknown Type

IP.com Disclosure Number: IPCOM000117485D
Original Publication Date: 1996-Mar-01
Included in the Prior Art Database: 2005-Mar-31
Document File: 4 page(s) / 93K

Publishing Venue

IBM

Related People

Butek, RJ: AUTHOR [+4]

Abstract

Disclosed is a method for collecting any set of homogeneous objects of unknown type derived from a known base class. A bag of apples, for example, is not a subclass of a bag of fruit. This method is useful in situations where it is desired that a bag of apples act like a subclass of a bag of fruit.

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

Mechanism to Collect a Set of Homogeneous Objects of Unknown Type

      Disclosed is a method for collecting any set of homogeneous
objects of unknown type derived from a known base class.  A bag of
apples, for example, is not a subclass of a bag of fruit.  This
method is useful in situations where it is desired that a bag of
apples act like a subclass of a bag of fruit.

      We are providing a framework that provides Object Oriented
surrogates which map to existing objects on an AS/400*.  One of the
objects is a Data Queue and its existing entries.  Each entry is made
up of two parts, a fixed header and a variable-length, user-defined
part.  This user-defined part is the data that the user is most
interested in.  It is typically a complex structure, not a simple
primitive value.

      We defined two classes as part of this framework, one to
represent the Data Queue and the other to represent an entry within
the Data Queue.  The class TAS400DataQueue represents the AS/400 Data
Queue, and the TEntry class represents an entry.  TEntry knows how to
model the fixed header but cannot know how to model the user-defined
portion since it is different for every user.

      One of the functions of the Data Queue class is to return a
collection of entries.  However, what the user wants is for the class
to return a collection of entries that models their entry.  Just
returning a collection of TEntry is not useful since TEntry does not
know the format of the user-defined portion of the entry, just its
length.

      The classical way to solve this problem is to require the user
to subclass TEntry to create a class called TMyEntry.  This class is
then extended to know how to model the user-defined portion of the
entry.  However, this is not enough.  The user now wants to get a
collection of TMyEntry returned from TAS400DataQueue, but
TAS400DataQueue returns a collection of TEntry, not TMyEntry.

      In order to do this, the user must also subclass
TAS400DataQueue and add a new method to parse the entry data to
return a collection of TMyEntry instead of TEntry.  A new method must
be provided because the signature of TAS4...