Aggregation

  • Thread starter Thread starter Nice Chap
  • Start date Start date
N

Nice Chap

Aggregation in COM was defined as 'Exposing an interface of an inner object
by the outer object as though it were an interface of the outer object'. Is
this type of aggregation possible in c#?

For example...

Class COuter - 'Contains' an instance variable of type CInner
Class CInner - Implements IList

Can COuter be made to look like its implementing IList?

Note: Implementing IList explicitly in COuter by calling corresponding
methods on CInner is not what I am after. In some articles on the web such a
practice is desribed as Aggregation when it is indeed 'Delegation'.
 
Hi,

I think the point to note is that no matter the technology
you choose to use, your inner and outer objects must
conform to certain rules.

Therefore, the question is whether you're looking for a
transparant mechanism to aggregate for you, or whether
you're willing to invest in a mechanism of your own which
will allow aggregation.

For instance, in order to implement Aggregation in COM you
must implement several intefraces that are part of the
aggregation capabilities that COM allows.

It is not clear from your question what exactly it is you
plan to do. Maybe if you elaborate on the specific
problem, a good solution will be suggested to you.

Shamshins Itamar
 
Back
Top