2 Replies Latest reply on Dec 12, 2007 7:58 PM by 807601

    inheritance and aggregation

      I have a question about this relation


      Class A has aggregation relationship with Class B

      Class B has aggregation relationship with Class C

      Class B has Inheritance relationship with Class D

      Class D has aggregation with Class E

      Class C and Class E have almost the same attributes and methods, is that mean that Class E has extended the Inheritance too or should I write the attributes and methods again??

        • 1. Re: inheritance and aggregation
          You've not made clear which one is the interface, but I don't think it does. This does not mean, however, that you should duplicate code.


          these are free and very useful for drawing UML diagrams (better than M$ Paint which is what you seem to have used):
          Umbrello http://uml.sourceforge.net/
          Dia http://live.gnome.org/Dia and for Windows http://dia-installer.de/index_en.html
          • 2. Re: inheritance and aggregation
            Thanks a lot, I will duplicate the codes I guess that would be better :) i'm new in UML I'll visit the links to learn more.

            I have another question can I use one of the classes as an abstract class?