Topic
IC4NOTICE: 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.
7 replies Latest Post - ‏2005-06-22T05:42:24Z by SystemAdmin
SystemAdmin
SystemAdmin
3659 Posts
ACCEPTED ANSWER

Pinned topic class diagram

‏2005-06-20T01:27:05Z |
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?
Updated on 2005-06-22T05:42:24Z at 2005-06-22T05:42:24Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    3659 Posts
    ACCEPTED ANSWER

    Re: class diagram

    ‏2005-06-20T08:02:04Z  in response to SystemAdmin
    1.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?
    • SystemAdmin
      SystemAdmin
      3659 Posts
      ACCEPTED ANSWER

      Re: class diagram

      ‏2005-06-21T02:58:23Z  in response to SystemAdmin
      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.

      kent
      • SystemAdmin
        SystemAdmin
        3659 Posts
        ACCEPTED ANSWER

        Re: class diagram

        ‏2005-06-21T12:03:44Z  in response to SystemAdmin
        Hi 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!!!
        Bond.
        > 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.
        >
        > kent
        • SystemAdmin
          SystemAdmin
          3659 Posts
          ACCEPTED ANSWER

          Re: class diagram

          ‏2005-06-22T02:12:45Z  in response to SystemAdmin
          Hi Bond,

          Now I have really understood it, thank you for your help.
          Have a nice day!

          Kent
      • SystemAdmin
        SystemAdmin
        3659 Posts
        ACCEPTED ANSWER

        Re: class diagram

        ‏2005-06-21T12:56:01Z  in response to SystemAdmin
        Parent 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.
        • SystemAdmin
          SystemAdmin
          3659 Posts
          ACCEPTED ANSWER

          Re: class diagram

          ‏2005-06-22T02:07:19Z  in response to SystemAdmin
          Thank you! Now I understand it.
        • SystemAdmin
          SystemAdmin
          3659 Posts
          ACCEPTED ANSWER

          Re: class diagram

          ‏2005-06-22T05:42:24Z  in response to SystemAdmin
          Thanks a ton Gogedd.... that was extremely useful. Had noticed it but never thought of the implications it could have.Its become clear now.Thanks!!