dcsimg
Has I got it Right?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Fredrik_Andersson
Posted On:   Wednesday, February 12, 2003 01:25 AM

Hello! I wonder if I understand UML correct when I look at my Java-code. I have made a image where you can take a look at it at http://medlem.spray.se/fredand44/umlquestion.jpg So please take a look at it and give me a comment, perhaps there is some role of thumb to use for Has-relations and know-relations? I have got this explanition for Aggregation but I have hard to understand it: An aggregation means that X has a reference to Y. Example: public class X { private Y y; public X(Y y) { this.y = y; } } Another class can also use y. Association just means that X uses Y.   More>>

Hello!


I wonder if I understand UML correct when I look at my Java-code. I have made a image where you can take a look at it at
http://medlem.spray.se/fredand44/umlquestion.jpg

So please take a look at it and give me a comment, perhaps there is some role of thumb to use for Has-relations and know-relations?



I have got this explanition for Aggregation but I have hard to understand it:



An aggregation means that X has a reference to Y.
Example:

public class X

{

private Y y;

public X(Y y)

{

this.y = y;

}

}



Another class can also use y.

Association just means that X uses Y.

It can be composition or aggregation.

It can also just be other use.






I thougt that Aggreagtion is a Has-relation not a know-realtion that I would say that the code above is.




Best regards

Fredrik    <<Less

Re: Has I got it Right?

Posted By:   rajeev_kumar  
Posted On:   Tuesday, February 18, 2003 01:07 PM

u should use aggregation in case of Wole Part RelationShip for exmple we can CAR and TYRE , TYRE is PART and CAR is whole such type of relationship depicit aggregation, then there is second level whether it is strong or weak that is whether one can exists without other, that is reffered as dependency if A is destroyed so is B Hpoe this helps on aggragation

Re: Has I got it Right?

Posted By:   Anonymous  
Posted On:   Thursday, February 13, 2003 04:12 AM

"UML for Java Programmers" contains a good description on this subject. You can get a pdf-script at http://www.objectmentor.com/UMLFJP. See page 27 as well as page 32 and following.

Did that help?

About | Sitemap | Contact