Claims
- 1. A method in a computer system of aggregating an enclosed object within an enclosing object, the enclosed object having an object management interface and an external interface, the enclosing object having a controlling object management interface, each interface having a query function member for receiving an identifier of an interface and for returning a reference to the identified interface, the method comprising the steps of:
creating an instance of the enclosing object, wherein the query function member of the controlling object management interface of the enclosing object receives an identifier of the external interface of the enclosed object and returns a reference to the external interface; and creating an instance of the enclosed object, wherein the query function member of the external interface of the enclosed object receives an identifier of an interface, invokes the query function member of the controlling object management interface of the enclosing object passing the received identifier, and returns a reference returned by the invoked query function member of the controlling object management interface of the enclosing object as a reference to the identified interface.
- 2. The method of claim 1 wherein the enclosed object is an aggregate object.
- 3. The method of claim 1 wherein the aggregate object is not an aggregatable object.
- 4. The method of claim 1 wherein the query function member of the controlling object management interface of the enclosing object has no specific knowledge of the external interfaces of the enclosed object.
- 5. The method of claim 1 wherein the query function member of the controlling object management interface of the enclosing object has specific knowledge of an external interface of the enclosed object.
- 6. The method of claim 1 wherein the query function member of the controlling object management interface of the enclosing object invokes the query function member of the object management interface of the enclosed object to retrieve a reference to an external interface of the enclosed object.
- 7. The method of claim 1 wherein the enclosing object stores a reference to the external interface of the enclosed object and wherein the query function member of the controlling object management interface of the enclosing object returns the stored reference as the reference to the external interface of the enclosed object.
- 8. A method in a computer system of implementing a class defining an aggregatable object, the class having an object management interface and an external interface, the object management interface and external interface having a query function member for providing access to the interfaces, the method comprising the steps of:
generating a create instance function member for instantiating an object of the class, wherein the create instance function member stores in a data member of the class a reference to the object management interface of the class when the object is not aggregated and stores in the data member of the class a reference to the controlling object management interface of an enclosing object when the object is aggregated; generating a query function member of the object management interface, the query function member for receiving an identifier of an interface of the object and returning a reference to the identified interface; and generating a query function member of the external interface, the query function member for receiving an identifier of an interface, invoking the query function member of the object management interface referenced by the data member passing the identifier of the interface, and returning a reference returned by the invoked query function member.
- 9. The method of claim 8, including the step of generating a global create instance function for instantiating an object of the class, wherein the global create instance function invokes the create instance function member to create an instance of the class and invokes the query function member of the object management interface to retrieve a reference to an external interface of the class whereby the global create instance function is invocable by a client to create an instance of the class without the client needing access to the class definition of the class.
- 10. A method in a computer system of creating an aggregate object, the aggregate object having an enclosed object, the enclosed object having an external interface that is exposed by the aggregate object, the method comprising the steps of:
instantiating the aggregate object, the aggregate object having a query function member for retrieving references to interfaces exposed by the aggregate object; instantiating the enclosed object, the enclosed object having a query function member of the external interface for retrieving references to interfaces exposed by the aggregate object; storing a reference to the enclosed object, wherein the query function member of the aggregate object uses the stored reference to the enclosed object to retrieve a reference to the exposed external interface; and storing a reference to the aggregate object, wherein the query function member of the external interface uses the stored reference to the aggregate object to retrieve a reference to an interface exposed by the aggregate object.
- 11. The method of claim 10 wherein the stored reference to the enclosed object is a reference to an object management interface of the enclosed object having a query function member and the query function member of the aggregate object invokes the query function member of the referenced object management interface to retrieve a reference to the exposed external interface.
- 12. The method of claim 10 wherein the stored reference to the enclosed object is a reference to the external interface of the enclosed object and wherein the query function member of the aggregate object uses the reference to the external interface as the reference to the exposed external interface.
- 13. The method of claim 10 wherein the query function member of the external interface uses the stored reference to the aggregate object to invoke the query function member of the aggregate object to retrieve a reference to an interface exposed by the aggregate object.
- 14. The method of claim 13 wherein the stored reference to the enclosed object is a reference to an object management interface of the enclosed object having a query function member and wherein the query function member of the aggregate object invokes the query function member of the reference object management interface to retrieve a reference to an exposed external interface.
- 15. The method of claim 10 wherein the external interface provides add reference and release reference counting function members and the aggregate object provides add reference and release reference counting functions and wherein the reference counting function members of the external interface of the enclosed object invoke the reference counting function members of the aggregate object.
- 16. A method in a computer system of enclosing an enclosed object within an enclosing object, the enclosing object having an query function member, the enclosed object having an query function member, the query function members for retrieving references to interfaces exposed by the enclosing object, the enclosed object having an external interface that is exposed by the enclosing object, the method comprising the steps of:
instantiating the enclosing object; instantiating the enclosed object; storing a reference to the enclosed object within the enclosing object; and when executing the query function member of the enclosing object, invoking the query function member of the enclosed object to retrieve a reference to an exposed external interface of the enclosed object using the stored reference to the enclosed object.
- 17. The method of claim 16, including the step of maintaining a reference count within the enclosing object that reflects a number of references to exposed interfaces of the enclosing object.
- 18. A method in a computer system of enclosing an enclosed object within an enclosing object, the enclosing object having an query function member, the enclosed object having an query function member, the query function members for retrieving references to interfaces exposed by the enclosing object, the enclosed object having an external interface that is exposed by the enclosing object, the method comprising the steps of:
instantiating the enclosing object; instantiating the enclosed object; storing a reference to the enclosing object within the enclosed object; and when executing the query function member of the enclosed object, invoking the query function member of the enclosing object to retrieve a reference to an exposed interface of the enclosing object using the stored reference to the enclosing object.
- 19. The method of claim 18, including the step of maintaining a reference count within the enclosing object that reflects a number of references to exposed interfaces of the enclosing object.
- 20. The method of claim 18 wherein the query function member of the enclosed object is associated with the external interface of the enclosed object and the enclosed object has an object management interface with a query function member and wherein the query function member of the enclosing object invokes the query function member of the object management interface of the enclosed object to retrieve a reference to an external interface of the enclosed object.
- 21. A method in a computer system of reference counting for an aggregate object, the aggregate object having an enclosing object and an enclosed object, the enclosing object having a reference count, the enclosing object having an add reference and a release reference function member, the enclosed object having an add reference and a release reference function member, the method comprising the steps of:
under control of the add reference function member of the enclosed object, invoking the add reference function member of the enclosing object, wherein the add reference function member of the enclosing object increments the reference count; and under control of the release reference function member of the enclosed object, invoking the release reference function member of the enclosing object, wherein the release reference function member of the enclosing object decrements the reference count.
- 22. The method of claim 21 wherein when the reference count indicates that no references to the aggregate object exists, deleting the enclosing and enclosed objects.
- 23. A method in a computer system of implementing a class defining an aggregatable object, the class having an object management interface and an external interface, the object management interface and the external interface having query function members for providing access to the interfaces of the aggregatable object, the method comprising the steps of:
defining the external interface; and defining the aggregatable class, the aggregatable class inheriting the defined external interface as a base class, the aggregatable class having an implementation of the query function member of the defined external interface, wherein the query function member of the defined external interface invokes the query function member of the object management interface when the object is not aggregated and invokes a query function member of an aggregating object when the aggregatable object is aggregated.
- 24. An aggregatable object in a computer system comprising:
an object management interface, the object management interface having a query function member for receiving an identifier of an interface of the object and returning a reference to the interface; an external interface, the external interface having a query function member for receiving an identifier of an interface, invoking the query function member of the object management interface when the object is not aggregated and invoking a query function member of an enclosing object when the object is aggregated, and returning a reference to the identified interface.
- 25. The method of claim 15 wherein the stored reference to the enclosed object is a reference to the external interface of the enclosed object and wherein the query function member of the aggregate object uses the reference to the external interface as the reference to the exposed external interface and invokes the add reference counting function member of the exposed external interface when retrieving the reference to exposed external interface.
- 26. A method in a computer system for adding an interface to an object, the interface implemented by an object being able to be enclosed into an enclosing object, the method comprising the steps of:
creating an instance of the enclosing object, the enclosing object having an add interface function member for adding an interface to the enclosing object and a query function member for retrieving a reference to an added interface; creating an instance of an object to be enclosed within the enclosing object, passing a reference to the enclosing object, the object to be enclosed having an interface and having a query function member for retrieving a reference to the interface; and invoking the add interface function member of the enclosing object, passing a reference to the object to be enclosed, thereby enclosing the object and adding the interface of the enclosed object to the enclosing object, whereby when the query function member of the enclosing object is invoked, the query function member of the enclosing object returns a reference to the added interface of the enclosed object.
- 27. The method of claim 26, wherein the invocation of the query function member of the enclosing object is performed asynchronously.
- 28. The method of claim 26, wherein the invocation of the query function member of the enclosing object is performed synchronously.
- 29. The method of claim 26, wherein the enclosing object provides a default interface.
- 30. The method of claim 26, wherein the enclosed object provides a default interface.
- 31. The method of claim 26, wherein the enclosing object provides an interface that overrides the added interface of the enclosed object.
- 32. The method of claim 26, wherein the enclosing object has no knowledge of the interfaces exposed by the enclosed object.
- 33. A method in a computer system for adding a plurality of interfaces, each interface implemented by an object being aggregatable into an enclosing object the method comprising the steps of:
creating an instance of an enclosing object, the enclosing object having an add object function member for adding all of the exposed interfaces of an object to the enclosing object and a query function member for retrieving a reference to an added interface; creating an instance of an object to be enclosed within the enclosing object, the object to be enclosed being aggregated into the enclosing object, the object to be enclosed having a plurality of exposed interfaces and having a query function member for retrieving a reference to an exposed interface; and invoking the add object function member of the enclosing object, wherein the plurality of exposed interfaces of the object to be enclosed is added to the enclosing object, whereby when the query function member of the enclosing object is invoked, the query function member of the enclosing object returns a reference to an exposed interface from the added plurality of exposed interfaces.
- 34. A method in a computer system for combining a plurality of interfaces, the interfaces implemented by a plurality of objects being aggregatable into an enclosing object, the method comprising the steps of:
creating an instance of an enclosing object, the enclosing object having an add interface function member for adding interfaces to the enclosing object and a query function member for retrieving a reference to an added interface; creating an instance of a first object to be enclosed within the enclosing object, whereby the first object is passed a reference to the enclosing object, the first object having an exposed interface and having a query function member for retrieving a reference to the exposed interface; creating an instance of a second object to be enclosed within the enclosing object, whereby the second object is passed a reference to the enclosing object, the second object having an exposed interface; invoking the add interface function member of the enclosing object, wherein the exposed interface of the first object is added to the enclosing object, thereby enclosing the first object; and invoking the add interface function member of the enclosing object, wherein the exposed interface of the second object is added to the enclosing object, thereby enclosing the second object, whereby when the query function member of the enclosed first object is invoked, the query function member of the enclosed first object returns a reference to the added exposed interface of the enclosed second object.
- 35. The method of claim 34, wherein the exposed interface of the enclosed second object overrides an interface of the enclosed first object.
- 36. The method of claim 34, wherein the exposed interface of the enclosed second object invokes an interface of the enclosed first object.
- 37. The method of claim 34, wherein the exposed interface of the enclosed second object is a default interface.
- 38. The method of claim 34, wherein the enclosing object provides a default interface for an enclosed object.
- 39. The method of claim 34, wherein the enclosing object provides an interface that overrides an interface of an enclosed object.
- 40. The method of claim 34, wherein the enclosing object has no knowledge of the interfaces exposed by enclosed objects.
- 41. The method of claim 34, wherein the invocation of the query function member of the enclosed first object is performed asynchronously.
- 42. The method of claim 34, wherein the invocation of the query function member of the enclosed first object is performed synchronously.
- 43. The method of claim 34, the enclosed first object containing a pointer to the enclosing object, the second object having a query function member for retrieving a reference to the exposed interface of the second object, and further including the steps of:
first, invoking the query function member of the enclosed first object requesting an exposed interface of the second object; second, retrieving a reference to the query function member of the enclosing object through the pointer to the enclosing object contained by the enclosed first object; third, invoking the query function member of the enclosing object, passing the requested interface; fourth, from the query function member of the enclosing object, invoking the query function member of the enclosed second object, passing the requested interface; and fifth, from the query function member of the enclosed second object, returning a reference to the requested interface.
- 44. The method of claim 34, the computer system having a device for persistent storage, further including the steps of
after enclosing an object into the enclosing object, thereby creating an aggregate object, storing the aggregate object on the persistent storage device; and subsequently loading the stored aggregate object from the persistent storage device.
- 45. The method of claim 44, the enclosing object having a retrieval data structure to keep track of enclosed objects, wherein the retrieval data structure can be created from the storage structure of the enclosed objects, and wherein the step of storing the aggregate object only stores the enclosed objects.
- 46. The method of claim 44, the enclosing object having a plurality of retrieval data structures for ordering retrieval of exposed interfaces, wherein the retrieval data structures can be persistently stored in the same file as the enclosed objects, and wherein the step of storing the aggregate object also stores the plurality of retrieval data structures.
- 47. A method in a computer system for changing the behavior of an object, the method comprising the steps of:
creating an instance of an enclosing object, the enclosing object having a query function member for retrieving a reference to an interface instance and an add rule function member for adding rules for determining to which interface instance to retrieve a reference; adding a plurality of interface instances to the enclosing object; and invoking the add rule function member of the enclosing object to add a rule for determining to which interface instance to retrieve a reference.
- 48. The method of claim 47, the method being language independent.
- 49. The method of claim 47, further including the step of invoking the query function member of the enclosing object to retrieve a reference to a requested interface, whereby the query function member of the enclosing object determines using the added rule to which interface instance to return a reference.
- 50. The method of claim 47, wherein the added rule combines the retrieval of a plurality of references to interface instances.
- 51. The method of claim 50, wherein each interface instance implements a same interface.
- 52. The method of claim 47, wherein the added rule is implemented by a rule object and wherein the step of invoking the add rule function member further includes the step of instantiating the rule object.
- 53. The method of claim 52, wherein the rule object combines the retrieval of a plurality of references to interface instances and the step of instantiating a rule object instantiates a rule object that provides the combined retrieval.
- 54. The method of claim 53, wherein each interface instance implements a same interface.
- 55. The method of claim 54, the rule object implementing the same interface, wherein the same interface belonging to the rule object implements the combined retrieval, whereby when the query function member of the enclosing object is invoked to retrieve a reference to the same interface, the query function member of the enclosing object returns a reference to the same interface belonging to the rule object, thereby combining the retrieval of multiple references to the same interface.
- 56. A method in a computer system for changing the behavior of an object, the method comprising the steps of:
creating an instance of an enclosing object, the enclosing object having a query function member for retrieving a reference to an interface instance and an add rule function member for adding rules for determining to which interface instance to retrieve a reference; adding a plurality of interface instances to the enclosing object; invoking the add rule function member of the enclosing object to add a first determination rule for determining to which interface instance to retrieve a reference; invoking the add rule function member of the enclosing object to add a second determination rule for determining to which interface instance to retrieve a reference; creating a selecting rule for selecting which determination rule to use for determining to which interface instance to retrieve a reference, whereby when the query function member of the enclosing object is invoked, the query function member uses the selecting rule to select between the first determination rule and the second determination rule, wherein the selected determination rule determines to which interface instance to retrieve a reference.
- 57. A method in a computer system for retrieving a reference to an interface instance from a plurality of interfaces instances each interface instance implemented by an object being aggregatable into an enclosing object, the method comprising the steps of:
creating an instance of an enclosing object, the enclosing object having an add interface function member for adding interface instances to the enclosing object, a query function member for retrieving a reference to an added interface instance, and an add rule function member for adding rules for determining to which added interface instance to retrieve a reference; creating an instance of a first object to be enclosed within the enclosing object, whereby the first object is passed a reference to the enclosing object, the first object having an exposed interface instance and having a query function member for retrieving a reference to the exposed interface instance; creating an instance of a second object to be enclosed within the enclosing object, whereby the second object is passed a reference to the enclosing object, the second object having an exposed interface instance and having a query function member for retrieving a reference to the exposed interface instance; invoking the add interface function member of the enclosing object, whereby the exposed interface instance of the first object is added to the enclosing object, thereby enclosing the first object; invoking the add interface function member of the enclosing object, whereby the exposed interface instance of the second object is added to the enclosing object, thereby enclosing the second object; invoking the add rule function member of the enclosing object to add a rule for determining to which added interface instance to retrieve a reference, whereby when the query function member of the enclosing object is invoked, the query function member determines from the added rule to which added interface instance to return a reference.
- 58. A method in a computer system for adding a function member to an object, the method being language independent and comprising the steps of:
creating an instance of an enclosing object, the enclosing object having an add function member for adding a function member to the enclosing object and a query function member for retrieving a reference to an added function member; creating an instance of an object to be enclosed within the enclosing object, passing to the object to be enclosed a reference to the enclosing object, the object to be enclosed having an implementation of a function member to be added to the enclosing object and having a query function member for retrieving a reference to the function member to be added; and invoking the add function member of the enclosing object, passing a reference to the object to be enclosed, thereby enclosing the object and adding the function member of the enclosed object, whereby when the query function member of the enclosing object is invoked, the query function member returns a reference to the added function member of the enclosed object.
- 59. A computer system for adding an interface to an object, the system comprising:
an enclosing object having an add interface function member for adding an interface to the enclosing object and a query function member for retrieving a reference to an added interface; and an object to be enclosed with the enclosing object, the object to be enclosed having an interface and a query function member for retrieving a reference to the interface, wherein the object is enclosed and the interface added by invoking the add interface function member of the enclosing object passing it a reference to the object to be enclosed, and whereby when the query interface function member of the enclosing object is invoked after the object is enclosed, the query interface function member returns a reference to the added interface of the enclosed object.
- 60. A method in a computer system for adding an interface to an enclosing object, after instantiation of the enclosing object, the method comprising the step of aggregating an object into the enclosing object, thereby enclosing the object, the enclosed object having an exposed interface, wherein the enclosed object forwards requests for an interface to the enclosing object, a reference to the exposed interface being accessible to the enclosing object, and wherein when the enclosing object receives a request for a reference to the exposed interface, the enclosing object returns the reference.
- 61. The method of claim 60, the enclosing object having references to a plurality of exposed interfaces, and further including the step of, after instantiation of the enclosing object, adding a rule for determining to which exposed interface to retrieve a reference, wherein when the enclosing object receives a request for a reference to an exposed interface, the enclosing object uses the added rule to determine to which interface to retrieve a reference.
- 62. A method in a computer system for combining a plurality of interfaces with an enclosing object, after instantiation of the enclosing object, the method comprising the steps of:
aggregating a first object into the enclosing object, thereby enclosing the first object, the enclosed first object having an exposed interface, wherein the enclosed first object forwards requests for an interface to the enclosing object; and aggregating a second object into the enclosing object, thereby enclosing the second object, the enclosed second object having an exposed interface, a reference to the exposed interface of the enclosed second object being accessible to the enclosing object, and wherein when the enclosed first object receives a request for a reference to the exposed interface of the enclosed second object, the enclosed first object forwards the request to the enclosing object and the enclosing object returns the reference to the exposed interface of the enclosed second object.
- 63. A method in a computer system for adding an interface to an object after the object is instantiated, the method comprising the steps of:
instantiating an enclosing object, the enclosing object for receiving a reference to an interface, for storing the reference, and for returning the stored reference when requested; instantiating an enclosed object, the enclosing object having a reference to the enclosed object and having an interface; and sending to the enclosing object a reference to the interface, whereby the enclosing object receives the sent references, stores the sent reference, and returns the stored reference when requested.
- 64. The method of claim 63, wherein when the enclosed object receives a request for an interface, it forwards the request to the enclosing object.
- 65. A method in a computer system for changing the behavior of an object having a plurality of instances of an interface, the method comprising the step of specifying after instantiation of the object, a rule interface to the object, the rule interface for retrieving an instance of the plurality of instances of the interface, wherein when the object is requested to retrieve a reference to an instance of an interface, the object selects the instance based on the rule interface.
- 66. The method of claim 65, wherein the method is language independent.
CROSS-REFERENCE TO RELATED APPLICATION
[0001] This application is a continuation in part for U.S. patent application Ser. No. 07/996,552, entitled “A Method and System for Aggregating Objects,” which was filed on Dec. 24, 1992, and which is hereby incorporated by reference.
Continuations (2)
|
Number |
Date |
Country |
Parent |
09098309 |
Jun 1998 |
US |
Child |
09859572 |
May 2001 |
US |
Parent |
08185465 |
Jan 1994 |
US |
Child |
09098309 |
Jun 1998 |
US |
Continuation in Parts (1)
|
Number |
Date |
Country |
Parent |
07996552 |
Dec 1992 |
US |
Child |
08185465 |
Jan 1994 |
US |