Author Topic: Fully functional API for TaggedValues  (Read 6160 times)

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Fully functional API for TaggedValues
« on: December 03, 2015, 03:45:00 am »
Hi,
A number of problems with the lack of proper API access to Default Values defined as UML Types (table t_propertytypes) needs a proper API.

The problems involved is described in detail in this post (from the fifth post in the thread) :
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1448991338/3

Although not describing here all the problem involved, there's an absolute need for adding two attributes to TaggedValue with the following functionality:

[size=11]TaggedValue.Value()
TaggedValue.DefaultValue()
TaggedValue.GlobalDefaultValue()[/size]

- DefaultValue() would retrieve what we could call "overridden" Default Values, if any, from the table corresponding to its parents type ( "t_<element type>tag"). This value is the value defined as "initial value" of the TaggedValue names when entered as attribute members to Stereotypes in Profile models.

- If no value is present, it returns the Default Value as defined in the table [size=12]t_propertytypes[/size], or better, from the property GlobalDefaultValue().  The logical flow would be as follows :

[size=12]
''' TaggedValue.DefaultValue()
Function DefaultValue()
    DefaultValue = ""
      If ContainsStr(Notes, "Default:") Then
            DefaultValue = '// The value to the right of "Default:"
      Else
            DefaultValue = GlobalDefaultValue()
      End If
End Function[/size]



[size=12]''' TaggedValue.GlobalDefaultValue()
Function GlobalDefaultValue()
      GlobalDefaultValue = '// Retrieve from the table "t_propertytypes"
End Function[/size]



Now the existing Value() property could have the following implementation:


[size=12]''' TaggedValue.Value()
Function Value()
      ''' The pseudo property "_Value" here represents the internal storage
      if _Value <> "" Then
            Value = _Value
      ElseIf DefaultValue() <> "" then
            Value = DefaultValue()
      ElseIf GlobalDefaultValue() <> "" Then
            Value = GlobalDefaultValue()
      Else
            Value = ""
      End If
End Function[/size]


"Polymorhism"
One could think of the approach as TaggedValues a sort of "polyphormism" for DefaultValues, sorts of, which in my case has proven being very very useful. This is when the same UML Types/TaggedValues are used in different contexts, i.e. in different Stereotypes.
Again, see a more detailed description of this workaround/feature in the linked post.

Hide complexity
The above functionality would hide the extra complexity due to TaggedValues having different ways of storing its info for different model element types, for example AssociationEnds, which needs to have the same support as any other group for TaggedValues (in my framework solutions the Role TVs are the most important, but they have the least support in EA).

Model Maintenance
The complexity of dealing with TaggedValues as EA API works today is a real problem, and when models or UML Types changes, updating the TaggedValues is, well a nightmare. I have no solution for that though, given how the values are stored today, which is an indicator of how this actually can become a showstopper for MDA Framework projects, which I'm into.

Performance
In my current (application Framework) model I have over 80 thousand Tagged Values to deal with (from Class, Attributes, Operations, Connections and ConnectionEnds). See the linked post for screenshots of the numbers involved.

Huge models, in turn, indicates that any solutions also needs to regard performance, since code generation from such a model is at risk of taking too long (maximum 1-2 minutes for a 250 classes model).

[edit]+Code Generation Template
Moreover, implementing this logic behind the Value() property would also bring the Code Generation Template system back to life, since it would suddenly start give access to the (default) values in TaggedValue system (given that the values of the [size=12]<element kind>Tag[/size]'s[/color] are actually read from the Value() property)[/edit]
Best regards,
// Rolf Lampa
« Last Edit: December 03, 2015, 04:58:59 am by Rolf_Lampa »
-- There's always a solution --

qwerty

  • EA Guru
  • *****
  • Posts: 12445
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Fully functional API for TaggedValues
« Reply #1 on: December 03, 2015, 05:54:36 am »
+1 (not only for a bit more orthogonality)

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8000
  • Karma: +211/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Fully functional API for TaggedValues
« Reply #2 on: December 03, 2015, 11:26:46 am »
+1

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

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: Fully functional API for TaggedValues
« Reply #3 on: September 28, 2020, 04:21:51 am »
== MDA FRAMEWORK LOOKING FOR A UML MODELLER ==

Has there been any progress on this? The lack of support for TaggedValues for AssociationEnds turned out to be a showstopper at the time so my then EA/Bold Framework project had to be postponed (or, abandoned for good?).

BREAKING NEWS:
News is that Embaracedro is open-sourcing the Bold Framework (see Embarcadero Announcement: https://blogs.embarcadero.com/bold-for-delphi-is-open-source/)

And now the community around this framework (yes, there's still a bunch of serious systems running on this framework) lacks a modern UML modelling tool (most of us still wrestle with old Rose98 or Rose 200x).

But EA could have been the tool of choice had the TV system gone all the way. Or has it been fixed since my original post on this?

BOLD RESSURECTED
In any case, Bold will come back to life, and people needs to have a capable modeling tool for the most advanced MDA out there. The community around the open sources all having their own sources which they bug-fixed, optimized, and enhanced with Unicode, x64 and many new features and addons are currently working hard on preparing their sources for sharing (merging) with the public repository on Github.

https://github.com/Embarcadero/BoldForDelphi

MODELLER TO USE
Please, tell me I can recommend EA as the tool of choice. At least respond to my question, which was: Is there support for TV's of AssiciationEnds ("roles") in newer versions of EA? (I stopped at EA v12.1 when I didn't even get an answer).

// Rolf

EDIT: Also related: https://www.sparxsystems.com/forums/smf/index.php/topic,10906.msg148467.html#msg148467
« Last Edit: September 28, 2020, 04:26:00 am by RIL »
-- There's always a solution --

qwerty

  • EA Guru
  • *****
  • Posts: 12445
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Fully functional API for TaggedValues
« Reply #4 on: September 28, 2020, 04:36:46 am »
No. Not in 15.1 (and likely you will not see it in any other upcoming version).(see below) Can you still recommend EA? It depends. If you compare it to other tools, then yes. It's still the cheapest and the expensive ones not necessarily have better tooling. Looking at EA as it is, then no. No bug fixing (to be fair: almost). No QA (that was dumped with probably V6 when marketing said so). Awkward UI (it's Sparxian - from another planet...). Incomplete API. Enough?

q.
« Last Edit: September 28, 2020, 08:46:26 pm by qwerty »

MichaelJ

  • EA User
  • **
  • Posts: 74
  • Karma: +14/-7
    • View Profile
Re: Fully functional API for TaggedValues
« Reply #5 on: September 28, 2020, 05:27:16 am »
...Looking at EA as it is, then no. No bug fixing (to be fair: almost). No QA (that was dumped with probably V6 when marketing said so)...
The statement "no bug fixing (...almost)" and "no QA" is true, borne of experience. Try it yourself. Log say, 50 bugs with as much detail as possible to help the team resolve and improve. Wait for fixes in the next release. Note, that Not. One. Bug. Is. Fixed. Not... One! As qwerty correctly states, paying customers then end up performing QA role to "test" functionality that should have been resolved before release. It's a very poor setup reflection against the EA product, because it could have been one of the best on the market.

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: Fully functional API for TaggedValues
« Reply #6 on: September 28, 2020, 05:41:30 am »
No. Not in 15.1 (and likely you will not see it in any other upcoming version). Can you still recommend EA? ... q.
Thanks for the quick reply!

Hm. Sounds like people at Sparx isn't really interested in what they are doing.  It's really like day and night compared to something way more complex than this "telephone book" level of complexity - Rhino3D for example. There the whole development team takes turns on the public (mcneel) forum to answer - and fix - problems with the software, and that is in addition to a dedicated forum-guy. Incredible people, polite, helpful, just...

Well, unique I guess. It sucks to have to deal with any other product/company, really. So, if you're into CAD (or development related to CAD, just go there and breath some fresh air. Here's an example when the chief architect gives me a hint about how to tweak into their (proprietary) Mesh class as to give me access to C++ speed when traversing mesh vertices. And a few days later they had added to the .NET API a whole bunch of super fast conversion methods to the Mesh.

https://discourse.mcneel.com/t/direct-access-to-struct-fields-for-gpu-compatibility/71033/22?u=ril

And with monthly minor releases (with weekly release candidtaes inbetween) we are now at Version 6.30(!) after three years since release of 6.0. That's kinda different compared to almost any other thing out there. But in comparison to EA... mm.

I can even follow "my issues" via their issue tracker:
https://mcneel.myjetbrains.com/youtrack/issues

So different. Gotta ask some space observatory to look out for on which different planet those guys enjoy their daily.

Have a good one!

// Rolf

« Last Edit: September 28, 2020, 05:46:47 am by RIL »
-- There's always a solution --

qwerty

  • EA Guru
  • *****
  • Posts: 12445
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Fully functional API for TaggedValues
« Reply #7 on: September 28, 2020, 06:42:44 am »
Yeah, that issue tracker was something we asked forever - and never got it. In the very beginning (before marketing; that means before V6) the Sparx team was at least very responsive on bug reports and feature request. Now there's only void.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11312
  • Karma: +422/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Fully functional API for TaggedValues
« Reply #8 on: September 28, 2020, 02:29:02 pm »
The lack of support for TaggedValues for AssociationEnds
I'm not sure what you mean by this. You can add tagged values to association ends since like forever.
I know because you need to do that in order to sort associations and attributes in XSD generation.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 12445
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Fully functional API for TaggedValues
« Reply #9 on: September 28, 2020, 05:30:14 pm »
I'm not sure what you mean by this. You can add tagged values to association ends since like forever.
I know because you need to do that in order to sort associations and attributes in XSD generation.

Geert
How?

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11312
  • Karma: +422/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Fully functional API for TaggedValues
« Reply #10 on: September 28, 2020, 05:46:11 pm »
- select the connector
- open the tagged values window
- click on Connector Source or Connector Target
- click on add tagged value button.

You can also modify them through the API: EA.ConnectorEnd.TaggedValues https://www.sparxsystems.com/enterprise_architect_user_guide/15.2/automation/connectorend.html

They end up in the t_taggedValues table (same as parameter tagged values)

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 12445
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Fully functional API for TaggedValues
« Reply #11 on: September 28, 2020, 06:23:07 pm »
? In V15 there is no tagged values window and in V13.5 the connector properties with the roles is a modal window.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11312
  • Karma: +422/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Fully functional API for TaggedValues
« Reply #12 on: September 28, 2020, 06:41:05 pm »
? In V15 there is no tagged values window and in V13.5 the connector properties with the roles is a modal window.

q.
in v15 the tagged values window is a tab in the properties window.
V13.5 you had the docked tagged values window.

You can also add/remove them from the modal properties window see https://imgur.com/a/Fh5Y12C

qwerty

  • EA Guru
  • *****
  • Posts: 12445
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Fully functional API for TaggedValues
« Reply #13 on: September 28, 2020, 08:44:05 pm »
Yes, found it. I should have been used to EAUI but it gets me somewhere any time. Taking back the statement about the missing support for TVs on association ends.

q.

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: Fully functional API for TaggedValues
« Reply #14 on: September 28, 2020, 08:55:16 pm »
Hi Geert,

I should have been clearer. I think the problem was either that the TV's were not autoinserted on AssociationEnds (when adding a link) like they are with all the other members and classes, or that the code generator didn't have properties for reading these TV's. I have to check which of these problems it was, or if it was both.

In either case, I had to give it up back then since I didn't even get a response on the problems I described at the time.

If the problem are fixed by now, then it's really good news because it's not trivial to find a tool which covers the MDA concept to 100%  (the other tool that comes close, but not all the way, is MDriven Designer. It has nice features (which I'm not interested in) but it's very slow and it lacks qualifiers on links and.. well, it's not complete. I think EA is closest to being complete.

// Rolf
« Last Edit: September 28, 2020, 08:57:26 pm by RIL »
-- There's always a solution --