Book a Demo

Author Topic: StereotypeEx and hop  (Read 5026 times)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
StereotypeEx and hop
« on: March 16, 2021, 12:39:26 am »
Ever since this Ex has been introduced it was claimed that it should be used instead of its still living predecessor without the Ex. Now, to my astonishment (or rather not), in V15.2 the stereotypeEx applied to an attribute is broken. i used to do something like

attr.stereotypeEx = "my_profile::some_stereo"

which worked well. Now I found out that in V15.2 this simply assigns NOTHING to the stereotype. Not a wrong one. Nothing. What actually works:

attr.stereotype = "some_stereo"

That finds the stereo from my profile and assigns it (also works with 13.5 so I go back to no-Ex here).

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: StereotypeEx and hop
« Reply #1 on: March 16, 2021, 12:46:03 am »
Are you sure you don't have a typo in the fully qualified stereotype?

Previous version tried to guess the stereotype, so I can imagine that "my_profile::sOmE_stEreO" used to work in 13.5, but not in 15.2

It also seems that the guesswork hasn't been disabled completely als assinging something to attr.stereotype still seems to use the guessing logic.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: StereotypeEx and hop
« Reply #2 on: March 16, 2021, 01:13:02 am »
Ooooppppssss and *blush*

We used to rename a part of the profile name from "Generic" to "General" and that still used the old format :-[ So in the elder EA it (erroneously) picked the desired stereotype (probably first removing the profile name and then doing a best match). So in the newer EA version it strictly ignores a wrong stereotype.

Come to think of that, EA lacks a concept of propagating exceptions upon such wrong assignments. They CAN raise exceptions as I found out in the past. But that's done only in a few places. The usual EA way is it just be silent (like when you have wrecked stereotypes in your diagram toolbox).

Oh well.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: StereotypeEx and hop
« Reply #3 on: March 16, 2021, 11:39:14 am »
Come to think of that, EA lacks a concept of propagating exceptions upon such wrong assignments. They CAN raise exceptions as I found out in the past. But that's done only in a few places. The usual EA way is it just be silent (like when you have wrecked stereotypes in your diagram toolbox).
Unfortunately, if we added an exception for that situation you would instead be asking why a situation that used to work now crashes. Adding exceptions to any situation that previously didn't throw them we can assume that old code doesn't handle the exception. So... boom.

It also seems that the guesswork hasn't been disabled completely als assinging something to attr.stereotype still seems to use the guessing logic.
I've said before that assigning to Stereotype instead of StereotypeEx is explicitly telling EA to guess.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: StereotypeEx and hop
« Reply #4 on: March 16, 2021, 09:10:58 pm »
Well, the Ex-issue was my fault. But the exception handling is an EA design error. At some places exceptions are thrown but most don't. I know it won't be fixed, so I will not start any discussion. It's just that from time to time I have to get some air...

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: StereotypeEx and hop
« Reply #5 on: March 16, 2021, 09:18:49 pm »
I agree that starting to throw exceptions suddenly won't make the API users happy.
But swallowing exceptions like that is also not helpful.

What if EA could write these type of exceptions to an error log of some kind? Or the system output, or something like that?

It wouldn't break any existing code, and it would still provide the feedback we require when something goes wrong.
Especially when dealing with MDG's that would be so useful. MDG's that fail silently are such a nightmare to debug

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: StereotypeEx and hop
« Reply #6 on: March 16, 2021, 10:43:02 pm »
I agree that starting to throw exceptions suddenly won't make the API users happy.
But swallowing exceptions like that is also not helpful.

What if EA could write these type of exceptions to an error log of some kind? Or the system output, or something like that?

It wouldn't break any existing code, and it would still provide the feedback we require when something goes wrong.
Especially when dealing with MDG's that would be so useful. MDG's that fail silently are such a nightmare to debug

Geert
Wot 'ee sed!

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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: StereotypeEx and hop
« Reply #7 on: March 16, 2021, 11:48:00 pm »
I'd vote for a new Repository attribute ThrowÈxceptions which, once turned on, would make what it says. Untouched EA can work the old way.

q.