Author Topic: Inheritance of attributes in EA  (Read 1241 times)

jplusip

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Inheritance of attributes in EA
« on: July 17, 2014, 01:58:23 am »
I made a thread like this earlier but deleted it when I realized that my operations would only be inherited by my subclass if I created the generalization association after I had filled in the operations.

However, now I'm running into an issue where the attributes of a superclass are not being inherited by the subclass regardless of what I do. Is there something I need to switch on in EA so that attributes can be inherited in a generalization association?  :-?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2464
  • Karma: +30/-2
    • View Profile
Re: Inheritance of attributes in EA
« Reply #1 on: July 17, 2014, 10:01:39 am »
Select the class and press Ctrl+Shift+Y. In the Feature and Compartment Visibility dialog, tick Inherited Features | Show Attributes.
The Sparx Team
support@sparxsystems.com

jplusip

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Re: Inheritance of attributes in EA
« Reply #2 on: July 18, 2014, 12:46:25 am »
Thank you for the help. However, the issue persists.

When I tried that with a class, it kind of worked. What I mean by that is this:


Here (where I'm dealing with UML classes Class1 and Class2), we see that using your process did make the inherited attribute a1 show up on the diagram. However, when I right click on Class2 then go to Features & Properties -> Attributes there is nothing. a1 is nowhere to be found.

However, my work is in SysML 1.3, so I was trying to get this to work with blocks. When I tried your suggestion on blocks it didn't even show the attribute on the block, and again:


And in this case the same box is checked:


So what could be going wrong here?
« Last Edit: July 18, 2014, 12:48:11 am by jplusip »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2464
  • Karma: +30/-2
    • View Profile
Re: Inheritance of attributes in EA
« Reply #3 on: July 18, 2014, 09:27:44 am »
1. SysML blocks don't have attributes; they have properties (parts).
2. Attribute a1 will not appear in the attributes list for Class2 because it's declared in Class1. That's the point of inheritance: that you don't have to duplicate the declaration.
« Last Edit: July 18, 2014, 09:46:54 am by KP »
The Sparx Team
support@sparxsystems.com

jplusip

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Re: Inheritance of attributes in EA
« Reply #4 on: July 22, 2014, 02:06:06 am »
Thanks for the help. A few more questions though:
1. How do I assign a value property to a block then? When I right-click a block, all I can find under Features & Properties are Attributes (which aren't valid) and Operations.

2. Why do inherited operations show up on the operations list but inherited attributes do not? I would think inherited attributes would show up in case one wanted to assign values to them.

jplusip

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Re: Inheritance of attributes in EA
« Reply #5 on: July 25, 2014, 01:22:52 am »
Nevermind. I figured it out.

I was looking for something that would allow me to edit the various compartments as shown in the Specification(s) and textbooks. However, I now see what you mean by "parts"; each value, property, constraint, etc. has to be a block somewhere else. And I just used generalization and got inheritance of a part, so that should solve my issue.

Thanks again for the help!  :)