This discussion is archived
2 Replies Latest reply: Dec 12, 2007 11:58 AM by 807601 RSS

inheritance and aggregation

807601 Newbie
Currently Being Moderated
hi,
I have a question about this relation

http://img143.imageshack.us/img143/1264/myproblemeq3.png

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??

thanks
  • 1. Re: inheritance and aggregation
    807601 Newbie
    Currently Being Moderated
    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.

    http://en.wikipedia.org/wiki/Unified_Modeling_Language

    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
    807601 Newbie
    Currently Being Moderated
    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?