Claims
- 1. 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.
- 2. 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.
- 3. The method of claim 2, wherein the exposed interface of the enclosed second object overrides an interface of the enclosed first object.
- 4. The method of claim 2, wherein the exposed interface of the enclosed second object invokes an interface of the enclosed first object.
- 5. The method of claim 2, wherein the exposed interface of the enclosed second object is a default interface.
- 6. The method of claim 2, wherein the enclosing object provides a default interface for an enclosed object.
- 7. The method of claim 2, wherein the enclosing object provides an interface that overrides an interface of an enclosed object.
- 8. The method of claim 2, wherein the enclosing object has no knowledge of the interfaces exposed by enclosed objects.
- 9. The method of claim 2, wherein the invocation of the query function member of the enclosed first object is performed asynchronously.
- 10. The method of claim 2, wherein the invocation of the query function member of the enclosed first object is performed synchronously.
- 11. The method of claim 2, 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.
- 12. The method of claim 2, 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.
- 13. The method of claim 12, 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.
- 14. The method of claim 12, 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.
CROSS-REFERENCE TO RELATED APPLICATION
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, now abandoned and which is hereby incorporated by reference.
US Referenced Citations (11)
Foreign Referenced Citations (1)
Number |
Date |
Country |
0 474 339 A2 |
Mar 1992 |
EPX |
Continuation in Parts (1)
|
Number |
Date |
Country |
Parent |
996552 |
Dec 1992 |
|