Book a Demo

Author Topic: show inherited attributes & methods  (Read 4326 times)

Duc-bert

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
show inherited attributes & methods
« on: April 17, 2002, 09:22:57 am »
Hi All,

if class diagram, how do I set so that a class displays any inherited attributes & methods? ( right-clicked on the class object and choose attribute option, a attribute window is displayed but none of the inherited stuff are displayed )

Thanks for your help
Duc-bert

ronnie

  • EA User
  • **
  • Posts: 81
  • Karma: +0/-0
    • View Profile
Re: show inherited attributes & methods
« Reply #1 on: April 17, 2002, 01:29:28 pm »
Have started reading UML Distilled by Martin Fowler (acclaimed as one of the bibles of UML) and I think the point about your question is that the model shouldn't show the derived methods in the sub-class unless you override them within the class.

Think not of the model as a place you can look and see what functions you can call like the object browser in VB, but a design tool.

If the inherited methods were shown in the sub-class then this would imply that the sub-class has these method functions defined which is not true unless they have been overridden.

EG:

class baseClass {
 void baseFunc(int x);    // base class function, baseClass::baseFunc()
 };

class A: public baseClass {
 void newFunc();          // A::newFunc()
 };

class B: public baseClass {
 void baseFunc(int x);    // overridden base class function, B::baseFunc()
 void newFunc();          // B::newFunc()
 };


When this is modelled, the A class should not have any of the inherited functions - the only method defined is A::newFunc().
However, Class B has both B::newFunc() and B::baseFunc() defined and so they should both be there.

Hope this helps.
Ronnie
Ronnie

Duc-bert

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: show inherited attributes & methods
« Reply #2 on: April 17, 2002, 05:09:08 pm »
Thanks ronnie. I understand your point but a CASE tool shouldn't limit this capability ( I know Describe UML tool has this option ).

Thanks :)