(
Continued)
More than one problemBut there's more than one problem with this redundant approach. If I use the UML type (TaggedValue) in more than one Stereotype, I need to define this "initial value" once for each one of them! (for example I have different Stereoptypes for Association (vba.aso), Aggregation (vba.aggr) and Composite (vba.comp), plus Class and AssociationClass. Which means that sooner or later you tend to lose consistency, and ultimately, you lose control.
PatienceBut if you are patient (very patient) you submit to the arrogance behind not bothering to fix such an annoying problem, not even after several years of complaints about this problem, and eventually you resort to defining the Defaults a little here and a little there, like so (the image shows one Stereotype, out of 5 redundant Stereotype definitions, of the same TaggedValue) :
RewardBut then again, you are rewarded with actually being able to access the values you enter into your EA models. Here's the proof:

Yup, there the Default values finally show up. Now the values are accessible through the code (GetTaggedValueValue) shown in the previous post.
Update Model?But then comes the next problem; What happens when the model changes (modifications in the TaggedValues)? This is the next nightmare which I posted about a few days ago.
I might have missed something very important, and if so I'm the cause of my own problems. But if this description of how default values work for TaggedValues is correct - and I didn't mention that Connection Roles stores these values in a different format, which add even more complexity - I really think there's reason to make life easier for me as a user of the tool.
Suggestion #1I'm aware of realities, backwards compatibility etc, but you guys really need to provide with at least one thing, soon, and that is one centralized place to retrieve ("global") Default values from.
The existing approach (entering "initial values" on Stereotype attributes) is still useful, because sometime one actually needs different Default Values in different contexts. For example, I use the same TaggedValue, VBA.FileName (mask), for Interfaces and Classes, but the default value are differnt (I<Name> for Interface, and T<Name> for Classes).
Suggestion #2The Default value could, in stead of being retrieved from .Notes) have it's own property, for example...
[size=11]DefaultValue()[/size]. That would give a mature impression.
This value would always present the "last defined" Default value, for example the "Initial value" defined in a Stereotype, in effect it would "override" any GloballyDefaultValue() defined in the UML Type definition.
Suggestion #3And it follows, yet another property should be provided for TaggedValues, namely
[size=11]GloballyDefaultValue()[/size] [/color]
Suggestion #4And of course, these two added properties should (in addition to actually accessing the ("globally" defalut values, as defined in the UML Types) be implemented for all Element types with support for Tagged values, which means:
- Classes
- Attributes
- Operations
- Connections
- ConnectionEnds
And, there must be
no difference in the API for accessing these TaggedValues. No difference. Preferably even the classtype of the TVs should be the same as to simplify code for traversing models (easier to generalize).
How to manage the TVs in Model Updates is yet another problem, but if the API is made to work, so as to be able to programatically set default values, then one can dump "Model Version Info", which can be modified and then put back again without destroying the manually modified settings, at least not without being aware of it. This doesn't seem to be possible as we speak, but it really must be made possible in order to be useful in "future safe" class models.
OK, that was my 2 cents for now.
// Rolf