Generalisations and visibility

34 views
Skip to first unread message

Force field

unread,
Aug 18, 2023, 10:30:13 AM8/18/23
to StarUML
I have set the visibility of a generalisation but its only on the diagram when I also set a name for the generalisation.  Is this working correctly?  I don't want to have names.  On paper I would write {-} for private inheritance and also {virtual} for virtual inheritance.

StarUML

unread,
Aug 18, 2023, 10:49:19 PM8/18/23
to StarUML
Hi,

It's hard to know exactly what your problem is. You can set visibility in Property Editor or Quick Edit. What do you mean "{-}"? Is it correct UML expression?

Thanks,

2023년 8월 18일 금요일 오후 11시 30분 13초 UTC+9에 forcef...@gmail.com님이 작성:

Force field

unread,
Aug 19, 2023, 3:21:08 AM8/19/23
to StarUML
The visibility symbol is not displayed unless I have set a name.  Is this a fault with StarUML?  When I write it on paper I write it as a constraint with braces.  That may not be the usual way but it is not relevant to the problem.

Jean Fex

unread,
Aug 19, 2023, 11:53:22 AM8/19/23
to StarUML
In UML 2.5.1, Visibility is a property of Named Elements. It is used to manage Namespaces. It is indicated by a single character on the left of the named element. A Generalization is not a Named Element so a Visibility is not relevant for generalizations in UML.
Private and Virtual inheritances are not Visibility properties and not UML concepts either. These kinds of inheritance may however be modeled as Constraints that are indicated in braces in UML.
With StarUML, you cannot add a constraint directly to a generalization which too bad. You have to add a constraint in your model with the Model Explorer and then move it under your generalization. You put the "-" or the "virtual" in the specification property and select your generalization as the constrainedElements property then drag the constraint in the diagram. It will automatically be attached to the generalization.
I hope it answers your question.
Jean

Force field

unread,
Aug 20, 2023, 5:04:49 AM8/20/23
to StarUML
Thanks for that.

Force field

unread,
Aug 21, 2023, 10:22:18 AM8/21/23
to StarUML
What is acheived by setting a constrained element?  Is it possible to have a constraint with multiple constrained elements and attached to multiple generalisations?  For instance {virtual} is commonly used with multiple inheritance and one constraint is all the diagram needs.

Jean Fex

unread,
Aug 21, 2023, 10:48:39 AM8/21/23
to StarUML
In UML 2.5.1 Section 7.6.1: "A Constraint is an assertion that indicates a restriction that must be satisfied by any valid realization of the model containing the Constraint. A Constraint is attached to a set of constrainedElements, and it represents additional semantic information about those Elements."
In StarUML, your can assign a constraint to any number of elements by adding them to its constrainedElements Property list. In the diagram, you will have to use the Note Link of the Annotation Toolbox to attach your Constraint to each generalization.
Reply all
Reply to author
Forward
0 new messages