1.Is there a compositon relationship in the rational rose software? How can I draw this relationship between the classes?
2.Using ralational rose draw the generalization relationship between the classes, the class directed by arrow is parent or child?
NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
7 replies Latest Post - 2005-06-22T05:42:24Z by SystemAdmin
Pinned topic class diagram
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2005-06-22T05:42:24Z at 2005-06-22T05:42:24Z by SystemAdmin
Re: class diagram2005-06-20T08:02:04Z in response to SystemAdmin1.Yes, there is a composition relationship included in Rose,known by the name of "by value aggregation".You can customize you toolbar to display the icon in your toolar.It is a line with an arrow at one end and a diamond at the other.
2.In generalization,the arrow points to the parent or base class or super class,whose methods are inherited by the sub classes.
> 1.Is there a compositon relationship in the rational
> rose software? How can I draw this relationship
> between the classes?
> 2.Using ralational rose draw the generalization
> relationship between the classes, the class directed
> by arrow is parent or child?
Re: class diagram2005-06-21T02:58:23Z in response to SystemAdmin1.I have found that icon in the toolbar,but I think it should be used for the aggregation relationship between the classes. For the composition relationship, the diamond should be dark according to the UML. Is that right?
2.Your answer is the same as what I am thinking. But in the Rational Rose enterprise edition(2003.06.13.402.000),when you select the class that we think it's sub class and see it's specification (double click that class), select the relations then you will see this class is Parent and the other is end class. Why?
Thanks for your replying.
Re: class diagram2005-06-21T12:03:44Z in response to SystemAdminHi Kent...
1.Yes,you are right..the composition is denoted by a dark diamond.Establish the aggregation relationship as you normally do between two classes,using the aggregation icon.Now,double click on the relation to open its specification.In the "Role A " detail (or Role B detail,as desired,just click the "by value" option.This will make the diamond dark,denoting composition,also known as by value aggregation.
2.the results are correct.the sub class inherits all the public and protected methods of the parent class.hence they should appear in its specification.The arrow points to parent.The child can use all the non private methods of parent as well as include some methods of its own,which is the very concept of inheritance,right??!!I guess you are able to see all the methods of parent class in specification of child.... i am using Rose 2000 Enterprise edition and that is how it appears here.
I hope I've been of some help to you.See ya!!!
> 1.I have found that icon in the toolbar,but I think
> it should be used for the aggregation relationship
> between the classes. For the composition
> relationship, the diamond should be dark according to
> the UML. Is that right?
> 2.Your answer is the same as what I am thinking. But
> in the Rational Rose enterprise
> edition(2003.06.13.402.000),when you select the class
> that we think it's sub class and see it's
> specification (double click that class), select the
> relations then you will see this class is Parent and
> the other is end class. Why?
> Thanks for your replying.
Re: class diagram2005-06-21T12:56:01Z in response to SystemAdminParent doesn't mean what you think it means in this context. Parent doesn't mean parent class of a child class. It means parent of the element. In this case, the element is the specialization relation; and the parent is the subclass. In Rose, a superclass doesn't know anything about its specialization relations. (Open the superclass specification and go to the Relations tab. There isn't an entry there for the relation between the superclass and subclass.) Since the subclass is the only class to know about the relation, it is the parent.
That is why you have to be careful when moving classes across packages and creating associations. Open the specification for any association and go to the General tab. Note that the parent listed is a Rose package. Associations are not "owned" by classes but by the package in which they were created. If you use the Main diagram under Logical View to create two classes and an association, all are members of Logical View. If you create a package name MyClasses and move the classes to that package, the association does not move with them but stays in Logical View. If you want the association to move, you need to move it yourself (a good reason to name associations -- it makes it easier to locate the correct one).
Associations are on the same level as Classes, but Relations and Dependencies are subordinate to classes.