file {query} or {const} after operation

1 month 3 weeks ago - 1 month 3 weeks ago #5984 by Robert Hairgrove
Is it possible to add such a constraint to an operation and have it displayed according to UML 2.5 specifications?

I can add the constraint, but if I place the text label to the right of the operation, I get a connection line going through the text of the operation which cannot be masked -- apparently, it always begins at the left of the operation.

The closest I have come so far is like this:


However, I would like to have it look like this (I took the screenshot above and edited it with the GIMP):


Any ideas? (BTW this is for a project using C++)
Attachments:

Please Log in or Create an account to join the conversation.

1 month 2 days ago #6006 by ebr
Hi,

Could you pointed out the description of this layout in the UML 2.5 specification?

Many thanks in advance,
EBR

Please Log in or Create an account to join the conversation.

1 month 2 days ago #6010 by Robert Hairgrove
In the 2.5.1 document, it is described on p. 117 (p. 159 of the PDF file) beginning at the bottom under §9.6.4 Notation. In the meantime, I have seen that it was actually specified as early as UML 1.4.

If you have Martin Fowler's "UML Distilled", 3rd edition, he describes this on p. 44 (similarly for attributes on p. 36). The third edition of his book supports UML 2.

The only difference between Fowler's use of {query} and the UML description is that the actual string specified by UML 2 is called {isQuery} and not just {query}. However, in the 2.5.1 specification shortly following 9.6.4:
<oper-property> indicates the properties of the Operation.
<oper-property> ::= ‘redefines’ <oper-name> | ‘query’ | ‘ordered’ | ‘unordered’ | ‘unique’ | ‘nonunique’ | ‘seq’ |
‘sequence’ | <oper-constraint>

But since my UML model will be for a C++ application, I would like to use
{const}
because this is what most developers are familiar with.

Please Log in or Create an account to join the conversation.

1 month 1 day ago #6011 by ebr
In short, I do not think that Modelio has a easy way to show {query} or {const} after an operation but I would like to clarify things.

Concerning {query}, according to UML 2.5.1 specification it is a keyword related to UML operation. So it should a be possible by using the Modelio "Properties" view but it is not the case. You can report it as an issue here .

Concerning {const}, if I well understand, this is not an UML feature. It is related to C++ code modelling. Maybe several tool use a constraint to model it but under Modelio it is not the case. You can specify it by Using the C++ view, cf below, but it is not depicted in the diagram or in the model explorer.



Hoping it is clear and it helps,
EBR
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: tma
Time to create page: 16.528 seconds
^ Back to Top