RAD Studio VCL Reference
TAggregatedObject Class

System::TAggregatedObject provides the functionality for an inner object of an aggregate by implementing the IInterface methods to delegate to the controlling IInterface.

TAggregatedObject = class(TObject);
class TAggregatedObject : public TObject;

An aggregated object is an object composed of several interfaced objects. Each object implements its own behavior and interfaces, but all of the objects share the same reference count, which is that of the controller object. In the container pattern, the controller is the container object. 

System::TAggregatedObject does not itself support any interfaces. However, as is typical of an aggregate, it does implement the methods of IInterface, which are used by the objects that descend from it. System::TAggregatedObject, therefore, serves as a base for classes that implement interfaces for creating objects that are part of an aggregate. 

System::TAggregatedObject is used as a base for classes that create contained objects and connecting objects. Using System::TAggregatedObject ensures that calls to the IInterface methods delegate to the controlling IInterface of the aggregate. 

The controlling IInterface is specified in the constructor for System::TAggregatedObject and is indicated by the System::TAggregatedObject::Controller property. 


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!