Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: pauljak 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
-
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
-
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
-
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
-
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
-
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