Author Topic: Class Attributes: How can I delete the {...} field?  (Read 619 times)

alexnt

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Class Attributes: How can I delete the {...} field?
« 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
« Last Edit: October 28, 2017, 01:39:13 am by alexnt »

qwerty

  • EA Guru
  • *****
  • Posts: 8952
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Class Attributes: How can I delete the {...} field?
« Reply #1 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.

alexnt

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Class Attributes: How can I delete the {...} field?
« Reply #2 on: October 28, 2017, 06:14:45 am »
No it is not visible. Both type fields only contains "unsigned short", nothing else.

qwerty

  • EA Guru
  • *****
  • Posts: 8952
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Class Attributes: How can I delete the {...} field?
« Reply #3 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.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7727
  • Karma: +165/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Class Attributes: How can I delete the {...} field?
« Reply #4 on: October 28, 2017, 02:54:29 pm »
Click on the multiplicity [..] and unselect "Allow Duplicates"

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 8952
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Class Attributes: How can I delete the {...} field?
« Reply #5 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.

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6190
  • Karma: +47/-5
    • View Profile
Re: Class Attributes: How can I delete the {...} field?
« Reply #6 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.
Simon

support@sparxsystems.com

qwerty

  • EA Guru
  • *****
  • Posts: 8952
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Class Attributes: How can I delete the {...} field?
« Reply #7 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.

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6190
  • Karma: +47/-5
    • View Profile
Re: Class Attributes: How can I delete the {...} field?
« Reply #8 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.
Simon

support@sparxsystems.com

alexnt

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Class Attributes: How can I delete the {...} field?
« Reply #9 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


qwerty

  • EA Guru
  • *****
  • Posts: 8952
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Class Attributes: How can I delete the {...} field?
« Reply #10 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.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2436
  • Karma: +29/-2
    • View Profile
Re: Class Attributes: How can I delete the {...} field?
« Reply #11 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?)
The Sparx Team
support@sparxsystems.com

alexnt

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Class Attributes: How can I delete the {...} field?
« Reply #12 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...

qwerty

  • EA Guru
  • *****
  • Posts: 8952
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Class Attributes: How can I delete the {...} field?
« Reply #13 on: November 02, 2017, 10:24:37 pm »
It's the IsID property (when set to True).

q.

Glassboy

  • EA User
  • **
  • Posts: 896
  • Karma: +52/-54
    • View Profile
Re: Class Attributes: How can I delete the {...} field?
« Reply #14 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.