Book a Demo

Author Topic: Interface? Interface!  (Read 12753 times)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Interface? Interface!
« on: March 20, 2013, 05:04:10 am »
I wonder what the difference might be:
  • A class with stereotype <<interface>>
  • A metatype interface (3rd entry in the class toolbox)
  • A metatype interface with stereotype <<interface>> (which you get if you use Element/Advanced/Change Type from class to interface if the class had the <<interface>> stereotype) [see below]

Two additional observations:

  • I also noticed that right after changing a stereotyped interface class to an interface metatype it will show with the stereotype in the browser until you select it some times. It appears that now the stereotype is removed and it's just the interface metatype left over.
  • I also turned on Show Realized Interfaces and (like some other guy recently) noticed that the lollipop can't be moved - what the heck? When using auto-layout it's additionally shifted out of sight to the left!

q.

[edit] Additionally, you may create a metatype Interface with stereotype <<interface>> (somehow that was created via add new element inside the select type dialogue for a parameter?!). So, what is this then?
« Last Edit: March 20, 2013, 05:22:51 am by qwerty »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Interface? Interface!
« Reply #1 on: March 20, 2013, 09:04:12 am »
Quote
A class with stereotype <<interface>>
Illegal in UML 2, but as with many rules, not enforced by EA. (As the «interface» keyword on a rectangle means that the rectangle is an interface, not any other sort of classifier.)

Quote
A metatype interface (3rd entry in the class toolbox)
The way UML expects it to be done.

Quote
A metatype interface with stereotype <<interface>> (which you get if you use Element/Advanced/Change Type from class to interface if the class had the <<interface>> stereotype) [see below]
An oddity. Stereotypes generally aren't removed during that process. EA will actually correct for you in time as you noticed.

Quote
I also turned on Show Realized Interfaces and (like some other guy recently) noticed that the lollipop can't be moved - what the heck? When using auto-layout it's additionally shifted out of sight to the left!
It's been that way forever, although I'm a little surprised about the layout. They are a static part of the drawing of the parent type (when turned on) similar to naming generalized classes in the top right of a class when they aren't on a diagram. The only difference is that they are drawn on the outside.


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Interface? Interface!
« Reply #2 on: March 20, 2013, 10:34:19 am »
Thanks for the clarification, Simon. Makes sense (counting the oddity as EAUI  ;)).

Regarding the lollipop: you should consider to make it behave like an embedded element. At least it should be considered in the auto-layout. Right now it seems that it simply does ignore it.

Probably I'll use a port with a provided interface which lets me move the lollipop. Do you know if there's a semantic difference between using interface and port/provided interface? From the GUI it's different as I have to type the provided interface while I realize an interface with the class on the other hand.

q.