Author Topic: What controls the inheritance of a stereotype?  (Read 3383 times)

peterc

  • Guest
What controls the inheritance of a stereotype?
« on: January 16, 2019, 10:53:31 pm »
I have created an MDG Technology. Within the technology I have created a stereotyped Block with the stereotype of "logical" (not including quotes!).

Within the EA file defining my MDG Technology, when I drag one of my logical Block elements onto an Internal Block Diagram the Property element inherits the stereotype of my Block. This was unexpected but good.

However, creating a new EA model, creating a new Block element (which correctly gets my logical stereotype) and dragging that onto an Internal Block Diagram, the stereotype is blank!

I didn't (so far as I understand...) create a logical stereotype Property within my MDG, so:
1. Why did the stereotype get inherited within the EA file defining the MDG Technology?
2. Why does it not get inherited within an EA file using my generated MDG Technology?
3. How can I make my file in (2) inherit the stereotype? The answer to this might be obvious from the answers to 1 & 2!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: What controls the inheritance of a stereotype?
« Reply #1 on: January 16, 2019, 10:58:30 pm »
Can you define what it means to "inherit" a stereotype?

Are you in fact talking about classifier/instance?

Geert

peterc

  • Guest
Re: What controls the inheritance of a stereotype?
« Reply #2 on: January 16, 2019, 11:09:16 pm »
By "inherit" I mean that my Block had a stereotype of "logical". The created Property also has a stereotype of "logical", without me actually specifying that it should.

Ought of curiosity, I have tried a little experiment. I changed the stereotype of one of my blocks to "random". When I drop this on my IBD in either EA model, it became a Property element with the stereotype of "random".

Even weirder, within the second EA file where the stereotype is not "inherited":
1. Drop a block on the block diagram (which has my default stereotype of logical)
2. Change the stereotype from logical to another word and back to logical
3. Drag this onto my IBD and it does become a Property with a stereotype of "logical"!

Repeat without step 2 (just because I thought I was going mad!) and the Property has no stereotype...

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: What controls the inheritance of a stereotype?
« Reply #3 on: January 17, 2019, 09:16:21 am »
If the stereotype is coming from a profile I don't think it will be copied to the property because it's explicitly applied to a single type. If my memory serves, specifying that it can also be applied to properties will result in it being copied. Otherwise there are metamodel options to specify how it should be created. (Either use _instanceMode and _instanceType or a metaconstraint connector with umlRole of Classifier/Type)


peterc

  • Guest
Re: What controls the inheritance of a stereotype?
« Reply #4 on: January 17, 2019, 08:21:22 pm »
Following Eve's suggestion, using _instanceType, I can get the desired logical property as an option when dropping a Block onto the IBD (internal block diagram), but only as an Instance. Also, only if a different stereotype is applied (I've chosen "logical property"), otherwise it picks up the block stereotyped as logical.

Regardless of what I put in _instanceMode I cannot get the Property option to appear (as it does using the standard SysML1.5 MDG). According to the MDG Technologies guide (page 50 of https://sparxsystems.com/resources/user-guides/14.0/modeling/mdg-technologies.pdf), if I set it to 'Property' (I assume without the quotes) then it should be offered as a Property. Why is this parameter being ignored? The guide does say that if it is not present then it defaults to Instance, but having set it to Property I would expect it to be obeyed.

Regarding the other point, I'd be interested to know what is necessary to specify to result in it being copied - I can't find mention of any special information to add to cause that to occur.