Sparx Systems Forum

Discussion => Uml Process => Topic started by: alexnt on October 28, 2017, 01:33:20 am

Title: Class Attributes: How can I delete the {...} field?
Post by: alexnt on October 28, 2017, 01:33:20 am
Hi,

I have a problem with some classes in our EA model. In a class diagram all attributes of some classes have an additional "field" right after the data type of the attribute (text in curly brackets {}) . I do not know how to upload an image of the class diagram but it looks like that:
+----------------------------------------+
|                  Class                         |
+----------------------------------------+
| - flag: unsigned short {bag}     |
| - seqNo: unsigned short {bag} |
+----------------------------------------+

I have asked my colleagues but no one knows were these additional text came from or even how to remove it!
Does anyone know how I can remove the "{bag}" text right after the data type?

I am using EA version 13.0
Title: Re: Class Attributes: How can I delete the {...} field?
Post by: qwerty on October 28, 2017, 04:13:14 am
I only can add this by typing it in the Type field of the attribute. Is it visible there? If so: remove it manually. If not: ???

q.
Title: Re: Class Attributes: How can I delete the {...} field?
Post by: alexnt on October 28, 2017, 06:14:45 am
No it is not visible. Both type fields only contains "unsigned short", nothing else.
Title: Re: Class Attributes: How can I delete the {...} field?
Post by: qwerty on October 28, 2017, 08:15:49 am
I skimmed the specs and found this on p. 111:
Code: [Select]
<property> ::= [<visibility>] [‘/’] <name> [‘:’ <prop-type>] [‘[‘ <multiplicity-range> ‘]’] [‘=’ <default>] [‘{‘ <prop-modifier > [‘,’ <prop-modifier >]* ’}’]
(see also below in the specs). So I altered he Union and IsConst drop downs which showed {readOnly,union}. I couldn't find the bag, except you mean the foo bar here xD

q.
Title: Re: Class Attributes: How can I delete the {...} field?
Post by: Geert Bellekens on October 28, 2017, 02:54:29 pm
Click on the multiplicity [..] and unselect "Allow Duplicates"

Geert
Title: Re: Class Attributes: How can I delete the {...} field?
Post by: qwerty on October 28, 2017, 06:24:08 pm
Indeed. If you read on at p. 111 you find
Quote
‘seq’ or ‘sequence’ means that the property represents an ordered bag, i.e., isUnique = false and isOrdered = true
The keyword "bag" is not mentioned, though. I guess, this is a bug in EA.

q.
Title: Re: Class Attributes: How can I delete the {...} field?
Post by: Simon M on October 30, 2017, 08:42:09 am
Open the diagram properties.
Go to the features page.
Uncheck 'Show Property String'

For the source of the notation, see Table 7.1 Collection types for MultiplicityElements in UML 2.5.
Title: Re: Class Attributes: How can I delete the {...} field?
Post by: qwerty on October 30, 2017, 09:15:02 am
Interesting. How can you set the other 3 from that table then (OrderedSet will probably mean "ordered" as EA displays)?

And as I poked in that area: How can you remove a Property once you set it. OK is disabled when you erase the name.

q.
Title: Re: Class Attributes: How can I delete the {...} field?
Post by: Simon M on October 31, 2017, 08:27:14 am
Sorry, the reference I provided doesn't list that as the notation for that type. The notation doesn't appear to match UML 2.5. It could come from SysML, or it could be from an older version of UML. Of course, it could also be a misinterpretation of the specification like my previous post.
Title: Re: Class Attributes: How can I delete the {...} field?
Post by: alexnt on November 01, 2017, 09:24:32 pm
Hi all,

Thanks for your help.
As Geert mentioned if "Allow Duplicates" is checked the {bag} property appears.
If "Multiplicity is Ordered" is checked the property is {ordered} and if both "Allow Duplicates" and "Multiplicity is Ordered" are checked the property is {sequence}.

Is this a bug or a feature? What does it mean in UML, I have never seen it before...

If you look in the EA user guide the {...} property seems to be editable. In the "Customer" class the Account attribute is set to {id}:
http://www.sparxsystems.com/enterprise_architect_user_guide/13.0/modeling_tools/attributes.html

Title: Re: Class Attributes: How can I delete the {...} field?
Post by: qwerty on November 01, 2017, 09:38:14 pm
Look into the UML 2.5 spec with the references mentioned above. It's sort of a historic deviation but not completely wrong. The values in the curly brackets are properties which are partially pre-defined per UML and partially seem to come from historic UML versions.

q.
Title: Re: Class Attributes: How can I delete the {...} field?
Post by: KP on November 02, 2017, 09:59:54 am
{bag} was replaced by {nonunique} for UML 2.2. EA hasn't caught up yet.

(I prefer bag. Why use a big word when a diminutive one would suffice?)
Title: Re: Class Attributes: How can I delete the {...} field?
Post by: alexnt on November 02, 2017, 10:08:02 pm
OK I got it.
So the {id} in http://www.sparxsystems.com/enterprise_architect_user_guide/13.0/modeling_tools/attributes.html has nothing to do with the multiplicity properties, it is something else...
Title: Re: Class Attributes: How can I delete the {...} field?
Post by: qwerty on November 02, 2017, 10:24:37 pm
It's the IsID property (when set to True).

q.
Title: Re: Class Attributes: How can I delete the {...} field?
Post by: Glassboy on November 03, 2017, 07:46:06 am
{bag} was replaced by {nonunique} for UML 2.2. EA hasn't caught up yet.

(I prefer bag. Why use a big word when a diminutive one would suffice?)

I don't like bag.  It's not descriptive and it has negative connotations.
Title: Re: Class Attributes: How can I delete the {...} field?
Post by: Paolo F Cantoni on November 03, 2017, 10:48:02 am
{bag} was replaced by {nonunique} for UML 2.2. EA hasn't caught up yet.

(I prefer bag. Why use a big word when a diminutive one would suffice?)

I don't like bag.  It's not descriptive and it has negative connotations.
Agree!

Paolo