OO Aggregation!

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

hey

Can OO Aggregation be described as:
- A system of objects that are built using each other

any comments?

Jeff
 
I feel it is a incomplete/ or rather wrong definition..

It has the idea, but not clearly seperate from it's close relatives such as
Association and Composition.

But what you really want to know

Nirosh.
 
Thanks, I'm studying C# for to take a certification exam on it. (my boss
wants me do it)... So yesterday I took a skill assessment test at
microsoft.com..... Today I'm reviewing what I answered, and checking what
I've done wrong. One of the questions was: Which of the following describe
the OO concept of Aggragation:

These were the alternatives answers:
#1: A system of objects that are not related
#2: A system of objects that are built using each other
#3: A system of objects that define each other
#4: A system of objects inherited from each other
#5: A system of objects that implement each other

I answered #2... but as you suggest #2 is a bit incomplete... do you have
any suggestion on which of the other definitions it could be?

Jeff
 
I keep feeling like I should sit some of the MS exams, but then it's
questions / answer sets like this that put me off. I worked through a few
of the online preparation tests and sometimes the answers are worded so
badly it's a lottery if you pass or not.

- Paul.
 
Hi Jeff,
#1: A system of objects that are not related

Aggregation implies containment, so I'd say that this is incorrect.

FYI, ownership of constituents is normally called composition. In terms of
disposal logic, this means that the Dispose method of a compositing object
will call Dispose on its components, whereas an aggregator wouldn't.
#2: A system of objects that are built using each other

True, but incomplete. This definition doesn't imply containment. "Using"
an object isn't exactly the same as containing it.
#3: A system of objects that define each other

The identity of the constituents are certainly not defined by the
aggregator, although one could argue that the aggregator is partially
defined by its constituents. I'd say this answer is wrong.
#4: A system of objects inherited from each other

Wrong. That is subtyping. Although, it's possible to have recursive
composition whereby a class composites itself or one of its subtypes, but
that certainly isn't the best definition for aggregation.
#5: A system of objects that implement each other

An aggregator doesn't implement its components and its components don't
normally implement the aggregator, except in recursive composition like I've
mentioned above. I'd say this answer is wrong.


So it seems #2 is the best choice; however, I'd say that it's not the best
definition of aggregation.
 
Back
Top