Object oriented mechanism and method for maintaining elements on a flexibly constrained collection that may use any suitable object as a key
First Claim
1. An apparatus comprising:
- at least one processor;
a memory coupled to the at least one processor;
an object oriented object mechanism residing in the memory and executed by the at least one processor, the object mechanism including;
a container class that contains a collection of elements;
a maintainer class that defines a maintenance interface to maintain elements on the collection, the maintainer class using the interface of the container class to maintain the collection;
a key class that defines at least one key object for the collection, each key object having a corresponding unique identifier and being assigned to one of the elements in the collection, the key class defining at least one object method for converting the unique identifier to a corresponding character string; and
a policy class that specifies at least one constraint on the maintenance of the elements in the collection;
wherein an instance of the maintainer class is invoked to create a new object in the collection according to a specified key object, and in response, the instance of the maintainer class creates the new object, invokes the at least one object method on a the specified key object to convert the unique identifier for the specified key object to a corresponding character string, and stores the new object in the collection using the character string as a key.
1 Assignment
0 Petitions
Accused Products
Abstract
In an object oriented computer system, an object oriented mechanism and method defines a common interface to maintain elements on a collection while providing the capability of using virtually any suitable object as a key to the collection. A programmer defines an interface on a collection that includes suitable object methods for adding, removing, and replacing elements of the collection. The constraints that determine whether elements may be added, removed, or replaced is encapsulated in a policy that is defined by the programmer. The programmer identifies one or more keys, which may include any suitable object in the object oriented system. A maintainer class provides a client interface for maintaining elements on the collection according to the defined policy and according to the keys defined by the programmer. The present invention recognizes the common characteristics that exist in maintaining elements on a keyed collection, and provide predetermined classes and class relationships that provide support for maintaining any collection using any key that a programmer may define.
17 Citations
7 Claims
-
1. An apparatus comprising:
-
at least one processor;
a memory coupled to the at least one processor;
an object oriented object mechanism residing in the memory and executed by the at least one processor, the object mechanism including;
a container class that contains a collection of elements;
a maintainer class that defines a maintenance interface to maintain elements on the collection, the maintainer class using the interface of the container class to maintain the collection;
a key class that defines at least one key object for the collection, each key object having a corresponding unique identifier and being assigned to one of the elements in the collection, the key class defining at least one object method for converting the unique identifier to a corresponding character string; and
a policy class that specifies at least one constraint on the maintenance of the elements in the collection;
wherein an instance of the maintainer class is invoked to create a new object in the collection according to a specified key object, and in response, the instance of the maintainer class creates the new object, invokes the at least one object method on a the specified key object to convert the unique identifier for the specified key object to a corresponding character string, and stores the new object in the collection using the character string as a key. - View Dependent Claims (2)
-
-
3. A method for maintaining elements in a collection, the method comprising the steps of:
-
defining a container class that contains the collection of elements;
defining a policy class that specifies at least one constraint on the maintenance of the elements in the collection;
defining a key class that defines at least one key object to the collection, each key object having a corresponding unique identifier and being assigned to one of the elements in the collection, the key class defining at least one object method for converting the unique identifier to a corresponding character string;
defining a maintainer class that includes at least one method that comprises the interface, the maintainer class using the interface of the container class to maintain the collection;
instantiating the container class, the policy class, the key class, and the maintainer class; and
invoking the instance of the maintainer class to create a new object in the collection according to a specified key object, and in response, the instance of the maintainer class creates the new object, invokes the at least one object method on a the specified key object to convert the unique identifier for the specified key object to a corresponding character string, and stores the new object in the collection using the character string as a key.
-
-
4. A program product comprising:
-
(A) an object oriented object mechanism including;
a container class that contains a collection of elements;
a maintainer class that defines a maintenance interface to maintain elements on the collection, the maintainer class using the interface of the container class to maintain the collection;
a key class that defines at least one key object for the collection, each key object having a corresponding unique identifier and being assigned to one of the elements in the collection, the key class defining at least one object method for converting the unique identifier to a corresponding character string;
a policy class that specifies at least one constraint on the maintenance of the elements in the collection;
wherein an instance of the maintainer class is invoked to create a new object in the collection according to a specified key object, and in response, the instance of the maintainer class creates the new object, invokes the at least one object method on a the specified key object to convert the unique identifier for the specified key object to a corresponding character string, and stores the new object in the collection using the character string as a key; and
(B) signal bearing media bearing the object mechanism. - View Dependent Claims (5, 6, 7)
-
Specification