Objects by Design Forums Here you can view your subscribed threads, work with private messages and edit your profile and preferences Registration is free! Calendar Find other members Frequently Asked Questions Search Home  
Objects by Design Forums : Powered by vBulletin version 2.3.5 Objects by Design Forums > Main Forums > UML Questions > aggregation vs. multiplicity
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
deanhiller
Junior Member

Registered: Apr 2003
Location:
Posts: 1

aggregation vs. multiplicity

I am very confused by aggregation and multiplicity.


In aggregation I may have this

diamond---------->

In multiplicity, I may have just this
0...*
-------------------->

What is the difference really? I would really appreciate an example in code of a realization of both. Are they the same? Also, I have seen aggregation where the multiplicity on the right side above was 1?? How is that possible? aggregation implies a collection. Was it a mistake? Any help appreciated here.
thanks,
Dean

Report this post to a moderator | IP: Logged

Old Post 04-05-2003 12:02 PM
deanhiller is offline Click Here to See the Profile for deanhiller Click here to Send deanhiller a Private Message Find more posts by deanhiller Add deanhiller to your buddy list Edit/Delete Message Reply w/Quote
umluser
Member

Registered: Jun 2003
Location:
Posts: 32

You are mixing 2 concepts here..

1> Aggregation is a type of association (composistion -- filled
diamond being the stronger one)

e.g. SoccerTeam<>--------Player

2> multiplicity denotes how many objects participate in a given
association

1..11
e.g. SoccerTeam<>-----------------Player
(minimum 1 & max 11 players form a team)

So, aggregation can be used with or without the multiplcity.
It is NOT one vs other.

Report this post to a moderator | IP: Logged

Old Post 06-13-2003 06:49 PM
umluser is offline Click Here to See the Profile for umluser Find more posts by umluser Add umluser to your buddy list Edit/Delete Message Reply w/Quote
ipreuss
Member

Registered: Mar 2003
Location:
Posts: 43

Re: aggregation vs. multiplicity

quote:
Originally posted by deanhiller
Are they the same?


No, they are totally orthogonal.

quote:
aggregation implies a collection.


No, it doesn't.

Aggregation is used to depict a so-called "is part of" dependency. Technically, the only implication (if at all) is that there can't be a circle in the object graph - that is, an object can't be part of itself, neither directly nor indirectly.

Aggregation really is very weakly defined in UML. There was even a movement to drop aggregation from UML 2.0.

See also http://martinfowler.com/bliki/Aggre...omposition.html

I would also recommend getting a copy of "UML for Java Programmers" by Robert C. Martin. It comes with many code examples.

Report this post to a moderator | IP: Logged

Old Post 06-15-2003 12:27 PM
ipreuss is offline Click Here to See the Profile for ipreuss Click here to Send ipreuss a Private Message Find more posts by ipreuss Add ipreuss to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 12:12 PM. Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 

< Contact Us - Objects by Design >

Powered by: vBulletin Version 2.3.5
Copyright ©2000 - 2017, Jelsoft Enterprises Limited.
Copyright 1999-2005, Objects by Design, Inc.