0

I have a bunch of classes that need inherit the same base class and interface. Having arrows from every concrete class makes the diagram very messy. I want do something like put the concrete classes in a "sub group" and just draw arrows from the base class and interface to the package, and everything inside the package will get this inheritance. Also, I saw generalization set, but this still requires many arrows, and is messy.

Something Like this:

BaseClass    Interface
    |         |     
    |         | 
    |         | 
    |         | 
    \/       \/
________________
|ClassA        |
|ClassB        |
|ClassC        |
|ClassD        |
________________

And have ClassA, ClassB, ClassC, and ClassD all inherit both BaseClass and Interface.

btw I am using visual paradigm.

ekad
  • 14,436
  • 26
  • 44
  • 46
user3657017
  • 103
  • 1
  • 3
  • 7

2 Answers2

0

There is not any way to group specialized classifiers or interfaces in UML. You must connect every specialized and general classifier with one separated generalization relationship. Generalization is direct relationship with exactly two ends. One for general and one for specialized classifier. If generalization set defined, you can use tree style connector. Tree style in generalization set defines,that specialized classifiers are specialized in the same generalization set. Tree style also makes your diagram more clear.

I recommend you to use more diagrams as well.

Vladimir
  • 2,066
  • 15
  • 13
0

Your question is not affected by your UML Deisgn Software, it's a more general U.M.L. question.

Altought UML Design Software is very helpful, I strongly suggest to try UML diagrams, from the whiteboard / notebook, point of view.

And, later, represent those diagrams, in your the software tool of your choice.

Since your classes descend from "BaseClass", and support "BaseInterface", remember that supporting one or more interfaces, it's also inhereted, by subclasses.

..................................................
..+------------------+......+------------------+..
..|    BaseClass     +--(o--+   BaseInterface  |..
..+------------------+......+------------------+..
..| [+] SomeProperty |............................
..+--------+---------+............................
...........|......................................
...........|......................................
...........^......................................
........../.\.....................................
........./...\....................................
........+-----+...................................
...........|......................................
...........|................+------------------+..
...........+----------------+   AChildClass    |..
...........|................+------------------+..
...........|......................................
...........|................+------------------+..
...........+----------------+   BChildClass    |..
............................+------------------+..
...........|......................................
...........|................+------------------+..
...........+----------------+   CChildClass    |..
............................+------------------+..
..................................................

In this example: "AChildClass", "BChildClass" and, "CChildClass", that are descendants of "BaseClass", inhereted the "SomeProperty" property. But, also inhereted support of the "BaseInterface" interface.

Most programming languages support this feature, altought, I remember watching some programming language, where the same interface support, had to be explicitly declared in each class.

Cheers.

umlcat
  • 4,091
  • 3
  • 19
  • 29