Book a Demo

Author Topic: Setting Instance Inherited Attribute Values  (Read 4154 times)

pauljak

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Setting Instance Inherited Attribute Values
« on: December 08, 2006, 01:45:07 pm »
My issue is around setting the attributes of the instances that are added because of the generalization.  Perhaps I'm missing a core UML concept and somebody can explain it to me.

Class1 is a generalization of Class2.  Each class has attributes assigned (attrib1 for Class1 and attrib2 for Class2).  After turning on the show inherited stuff feature, Class1 correctly shows both attributes (attrib1 and attrib2).

Now I want to create an instance of Class1 named Paul.  Again it correctly shows both attributes within the box, however it doesn’t show me attrib2 in the attributes box, where I could set values associated with the instance.  I can set a value for attrib1, which is directly contained within the classifier that the instance is based on.  Why can’t I set a value for attrib2 which is included because of the generalization?  Also, when I change the attribute values on the instance it updates the original class as well.  I wouldn't have expected an instance to update the source class.

Thanks,
Paul

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Setting Instance Inherited Attribute Values
« Reply #1 on: December 08, 2006, 02:38:24 pm »
Try this:

Select a child element and right-click to bring up the context menu (or use the Element pad of the main menu). Choose Set Feature Visibility (or use the Ctrl-Shift-Y shortcut).

You'll see two settings under Inherited Features. These are off by default, so you would not normally see them.

HTH, David
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Setting Instance Inherited Attribute Values
« Reply #2 on: December 08, 2006, 03:22:49 pm »
Quote
My issue is around setting the attributes of the instances that are added because of the generalization.  Perhaps I'm missing a core UML concept and somebody can explain it to me.

Class1 is a generalization of Class2.  Each class has attributes assigned (attrib1 for Class1 and attrib2 for Class2).  After turning on the show inherited stuff feature, Class1 correctly shows both attributes (attrib1 and attrib2).

[size=13][SNIP][/size]
Actually Paul,

You have made an (understandable) UML error...  According to your description Class 1 is a Specialization of Class2.  The Generalization relationship in UML is the "exception that proves the rule" in the it is defined in the reverse of the conventional direction (where the client (origin) «relates» to supplier (destination) - try it with all the others).  Elsewhere I have written that the Generalization relationship should be renamed Specialization for consistency.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

pauljak

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Setting Instance Inherited Attribute Values
« Reply #3 on: December 08, 2006, 03:24:53 pm »
I've got it showing the attributes in the Instance, but I'm trying to actually set attribute values associated with the instance.  

I thought that because it was an instance you could set those attribute values specifically for that instance.

Paul

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Setting Instance Inherited Attribute Values
« Reply #4 on: December 08, 2006, 03:36:24 pm »
Quote
I've got it showing the attributes in the Instance, but I'm trying to actually set attribute values associated with the instance.  

I thought that because it was an instance you could set those attribute values specifically for that instance.

Paul
You want <context menu>|Advanced|Set Run State [Ctrl+Shift+R] on the selected object.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

pauljak

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Setting Instance Inherited Attribute Values
« Reply #5 on: December 08, 2006, 05:55:30 pm »
Thanks Paolo, that was exactly what I was looking for.

Maybe you can tell me how to get the HTML generator to include the Run States too?  The RTF generator does include the Run States.

Paul
« Last Edit: December 08, 2006, 05:56:07 pm by pauljak »