Page 1 of 1

How to add inheritance to a class not using diagram?

PostPosted: Sat 24 Mar 2012 21:34
by thomas.beale
I want to specify that class X inherits from class C, but class C is not on the current diagram. There appears to be no way to add an ancestor in the explorer view?

Re: How to add inheritance to a class not using diagram?

PostPosted: Sat 24 Mar 2012 22:33
by Bruno Pagès
Yes you need to have the two classes in a class diagram to add the inheritance or other relations between them. After that you can remove one or the two classes, or the diagram itself, if you don't want to show the relation in a diagram.

Let's remark you can also write a plug-out to add the inheritance without having to use a diagram, in this case the plug-out will be applied for instance on the inheriting class and the inherited class may be marked to simplify the implementation of the plug-out and minimize manual manipulations ;)

Re: How to add inheritance to a class not using diagram?

PostPosted: Mon 26 Mar 2012 12:15
by thomas.beale
Is there any reason not to allow a right-click dialog to add inheritance in the explorer tree, just as for adding attributes? It seems like a natural thing to have...

- thomas

Re: How to add inheritance to a class not using diagram?

PostPosted: Mon 26 Mar 2012 13:01
by Bruno Pagès
To create an attribute in a given class (or other named element in any container) is simple because it is just needed to specify first its name.

To create a relation it is needed to know the opposed side (I don't manage relations on air and I don't allow to change the extremities of a relation), so to allow that it should be necessary to use a dialog giving the (long) list of all compatible elements and I don't think this is easy to use, even if the kind of the relation is already known (having a long list of menu entries proposing the possible kind of relations for a given element depending on its type etc, or having a first level dialog to set the kind of the relation before a second level to choose the opposite side). Furthermore to hide an important relation like an inheritance rather than to show it in a least a diagram is a little bit the opposite of the UML goal/usage (my two cents).

Again this may be a good reason for you to develop a plug-out to extend Bouml (almost) as you like, the plug-out mechanism is a very important feature of Bouml probably not enough used, take time to write the first and I think you will write a lot after understanding all you can do with to help your work.