Book a Demo

Author Topic: v15.1 - Extra Attributes in MDG  (Read 3985 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
v15.1 - Extra Attributes in MDG
« on: May 05, 2020, 04:59:27 pm »
I was wandering through our hand-crafted MDG and accidentally found a metatype entry with an additional attribute.
what I found was:
Code: [Select]
... borderwidth="-1" hideicon="0" strictness="all" nature="Arc">
The "nature" attribute is non-standard.  It was added in the "mists of time" as no one can remember putting it there.  It seems to be non-problematic (since it doesn't seem to have broken anything over many versions) and we'd like to use this concept to categorise the metatypes.

Has anybody done anything similar?
It would seem to me that since there is NO XSD for the MDG file, normal XML processing would allow this kind of thing "with no loss of generality", but I'm no XML expert.  Can anyone comment?

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: v15.1 - Extra Attributes in MDG
« Reply #1 on: May 05, 2020, 05:32:41 pm »
Who knows? For the fun I added that attribute to an existing connector in a profile. And nothing changed. Of course no complaints from EA. The connector seems to behave normally. I added some randomly named attribute and that also made no difference.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: v15.1 - Extra Attributes in MDG
« Reply #2 on: May 06, 2020, 08:46:35 am »
I would agree it's unlikely to cause an issue. There's a very small chance that we may add an attribute with the same name as yours that could cause an issue because of unexpected values. As long as you're happy to take that risk I can't think of a reason why you shouldn't do it.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15.1 - Extra Attributes in MDG
« Reply #3 on: May 06, 2020, 10:56:15 am »
I would agree it's unlikely to cause an issue. There's a very small chance that we may add an attribute with the same name as yours that could cause an issue because of unexpected values. As long as you're happy to take that risk I can't think of a reason why you shouldn't do it.
Thanks Eve,

I'm happy to take that risk.  I have techniques to mitigate and anyway we'd know beforehand I expect.

It would be useful to be able to "model" these up.  I note, for example, that the "_instanceType" special attribute has been deprecated.  Is it still emitted?  If so, we could "hijack" that attribute, renaming it in the generated MDG.

Paolo

[EDIT:  Just realised, there's no guarantee that the "Special Attribute" will end up as an XML attribute - rather than an XML element]
« Last Edit: May 06, 2020, 11:00:54 am by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!