Book a Demo

Author Topic: Difference between Properties and Attributes and Values in EA SysML  (Read 15718 times)

avi10000

  • EA User
  • **
  • Posts: 201
  • Karma: +0/-0
  • Programmer/Writer
    • View Profile
Hi all,
I assume this question has been asked many times before in some incarnation, but I cannot find an explicit definition in terms of "difference between...".

In EA SysML, what is the quintessential difference between EA SysML properties and EA SysML attributes?

I want to be able to provide a list of key data items for (i) System blocks and (ii) Ports and data flows along connectors (between blocks). Back in my programming days we used to call them attributes.

They both appear in the Features window (Attributes tab and Parts/Properties tab).
They both allow you to type them type as  a ValueType, if you so wish.

Some differences:
Parts are the same elements we use to model sub-blocks (for composition). So I would not like to use the parts concept also for a data item list.
Parts allow you to make complex data structures (the plus side of composition). Attributes do not allow this, I believe.
Attributes allow you to set as private/public. For data flow objects this is not appropriate.

I feel it is important to be consistent, i.e., go with one type of the other, i.e., properties or attributes.

From the above list of differences it seems that Parts/Properties is preferable, but as mentioned, it does not seem appropriate that these are also the same elements I use to model system sub-blocks.

Comments?

Thanks
- Avi

Edited: Fixed some grammar.



« Last Edit: December 01, 2020, 10:54:30 am by avi10000 »

avi10000

  • EA User
  • **
  • Posts: 201
  • Karma: +0/-0
  • Programmer/Writer
    • View Profile
Re: Difference between Properties and Attributes in EA SysML
« Reply #1 on: November 18, 2020, 01:01:17 pm »
>> Parts allow you to make complex data structures (the plus side of composition). Attributes do not allow this, I believe.

I correct myself. Attribute can be typed by valueType, and valueType can contain a number of elements, e.g. x, y, and z of a 3D point. However, I don't think you can nest them. 

So maybe in the above is the difference: maybe you use parts to nest, i.e., make the multi-level data structures, but for the actual values (the leaves of the tree), you use <<valueType>>.

Comments?
 

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Difference between Properties and Attributes in EA SysML
« Reply #2 on: November 19, 2020, 07:44:55 am »
Attributes and Parts are alternative renderings of the UML4SysML::Property metaclass. Choose whichever best illustrates your modeling goal. You will probably want to use Parts for structural properties and Attributes for simple member variables.
The Sparx Team
[email protected]

avi10000

  • EA User
  • **
  • Posts: 201
  • Karma: +0/-0
  • Programmer/Writer
    • View Profile
Re: Difference between Properties and Attributes in EA SysML
« Reply #3 on: December 01, 2020, 10:53:48 am »
Attributes and Parts are alternative renderings of the UML4SysML::Property metaclass. Choose whichever best illustrates your modeling goal. You will probably want to use Parts for structural properties and Attributes for simple member variables.

Thank you, KP.

avi10000

  • EA User
  • **
  • Posts: 201
  • Karma: +0/-0
  • Programmer/Writer
    • View Profile
Re: Difference between Properties and Attributes and Values in EA SysML
« Reply #4 on: December 01, 2020, 10:57:19 am »
Now I have learned a bit more, I think my question was a bit of dumb question (or would be good as a trick question):
SysML (OMG SysML v1.6) does not seem to define 'attributes' at all. The term attributes is used only in the most general sense in the books SysML Distilled and Practical Guide to SysML. ('attributes' is defined in UML and used extensively).

A better question that I could have asked is:

1.  What is the difference between properties and values in EA SysML?
     And I assume the answer is as above, i.e.,  save the part/properties concept for structural definitions.

And another question:

2. Is it correct to always use a <<ValueType>> block to define values?
    Or are there times when it is more correct to use a <<block>> block to define values (where the block defines
    value items and they appear in the Values compartment)?

TIA

Avi

Edited: Added "and Values" to the subject line.

RobCDeJong

  • EA User
  • **
  • Posts: 29
  • Karma: +4/-0
    • View Profile
    • Soltegro site
Re: Difference between Properties and Attributes and Values in EA SysML
« Reply #5 on: December 01, 2020, 06:28:09 pm »

1. the above answer is the most practical. There are reasons not to use parts for everything: for example when you want to generate code for a software block. For the code generation, only attributes can be used (as they are basically UML structures).

2. A value type is a data type, see the definition in the standard: "A ValueType defines types of values that may be used to express information about a system, but cannot be identified as the target of any reference. Since a value cannot be identified except by means of the value itself, each such value within a model is independent of any other, unless other forms of constraints are imposed."
Simply put, a value type cannot be instantiated whereas a block should have an instance to be useful.

avi10000

  • EA User
  • **
  • Posts: 201
  • Karma: +0/-0
  • Programmer/Writer
    • View Profile
Re: Difference between Properties and Attributes and Values in EA SysML
« Reply #6 on: December 02, 2020, 11:36:57 am »

Thanks, Rob.

(1) That was great. Just what I need to hear at the right time. Thanks.

(2) Ok, here is what I meant to ask: Is it correct to always use a <<ValueType>> block to define a type that contains a list of values

E.g., In Practical Guide to SysML (3rd edition), fig 7.25, p.141 writes <<block>> (rather than <<valuetype>>) to define a 'Light'* data type as below. Why would he use a block to define a data type (the Light data type)?
---------------------------------
|           <<block>>            |
|             Light                    |
----------------------------------
|            values                 |
| flux: W (unit=Watt)          |
| illuminance: lx(unit=lux)   |
---------------------------------

(3) Further: Now I actually tried to do define values in EA … EA does not do values...
EA does value types only. So you define attributes, and type them with value types. So that is the best way to anwer my original question about values...

 - Avi


RobCDeJong

  • EA User
  • **
  • Posts: 29
  • Karma: +4/-0
    • View Profile
    • Soltegro site
Re: Difference between Properties and Attributes and Values in EA SysML
« Reply #7 on: December 02, 2020, 08:03:25 pm »
In this example Light is not a data type as it represent a flow. It states that the light flows into the camera, so light is modeled as an item and therefor should be a block.

avi10000

  • EA User
  • **
  • Posts: 201
  • Karma: +0/-0
  • Programmer/Writer
    • View Profile
Re: Difference between Properties and Attributes and Values in EA SysML
« Reply #8 on: December 08, 2020, 11:14:22 pm »
In this example Light is not a data type as it represent a flow. It states that the light flows into the camera, so light is modeled as an item and therefor should be a block.

The penny dropped. This is great. Thanks!

However ...
1. Don't we say that using blocks (=parts) should be preserved for structural aspects? I.e., for composing system units by sub-system units?

2. Further, in that book, flux 'value' etc is in a values compartment.

In EA (15.1), I do not see a Value element in the Toolbox or in the Features pane.

EA offers attributes in the Features pane. So in EA, to define the above (from the Friendenthal book) do we add attributes?

Thanks
 
 -avi
« Last Edit: December 09, 2020, 12:31:42 am by avi10000 »

Carl

  • EA User
  • **
  • Posts: 24
  • Karma: +1/-0
    • View Profile
Re: Difference between Properties and Attributes and Values in EA SysML
« Reply #9 on: December 10, 2020, 01:49:44 pm »
Drag a Property shape from the Toolbox onto your Block.  Name the Property the value name.  In the Properties panel, set the Type to your Value Type.  Remove the Property shape.  The Values compartment will appear.

It seems tedious to add an item only to remove a few clicks later.  I posted a question this afternoon to see if there were more efficient ways of adding Values.

avi10000

  • EA User
  • **
  • Posts: 201
  • Karma: +0/-0
  • Programmer/Writer
    • View Profile
Re: Difference between Properties and Attributes and Values in EA SysML
« Reply #10 on: December 11, 2020, 02:04:37 pm »
Quote
Drag a Property shape from the Toolbox onto your Block.  Name the Property the value name.  In the Properties panel, set the Type to your Value Type.  Remove the Property shape.  The Values compartment will appear.

Thanks, Carl. This works. My Block X -- that I am using to provide a type flow elements -- now has a Values compartment, and I see the value listed.

Avi
« Last Edit: December 11, 2020, 11:23:34 pm by avi10000 »

potterm

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Difference between Properties and Attributes and Values in EA SysML
« Reply #11 on: January 13, 2023, 05:33:52 pm »
Drag a Property shape from the Toolbox onto your Block.  Name the Property the value name.  In the Properties panel, set the Type to your Value Type.  Remove the Property shape.  The Values compartment will appear.

It seems tedious to add an item only to remove a few clicks later.  I posted a question this afternoon to see if there were more efficient ways of adding Values.

Another way is to click on Property in the toolbox and then click on your Block in the project browser.  This adds the property directly to the Block without having to add the shape to the diagram.  You will probably have to refresh the diagram to see the new property however.