Book a Demo

Author Topic: Can you convert a class to an interface?  (Read 5502 times)

Andrew_F

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Can you convert a class to an interface?
« on: July 24, 2007, 10:51:36 am »
Hi,
I'm fairly new to EA (and UML), so probably something pretty obvious I'm missing, but can you convert a class element into an interface element? I tried stereotyping, with no luck.

Basically I have reverse engineered some classes from brought-in C++ code and the (logical) interfaces have been created as classes in the model (unsurprisingly).

Never thought this a problem until I tried to create composite classes and the ball and socket will only accept an interface element, not a class tagged as <<interface>>.

I'd appreciate any help on this,

Thanks,
Andrew

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Can you convert a class to an interface?
« Reply #1 on: July 24, 2007, 01:09:12 pm »
Select the class, then Element|Advanced|Change Type...  Interface is on the drop-down list.

You may wonder, Andrew, why this functionality is NOT on the class' <context menu>...  Wecome to EA's UI - unique interface.

HTH,
Paolo
« Last Edit: July 24, 2007, 01:09:49 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Andrew_F

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Can you convert a class to an interface?
« Reply #2 on: July 24, 2007, 10:27:15 pm »
That's the trick!

Thanks very much Paolo.

Best Regards,
Andrew

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Can you convert a class to an interface?
« Reply #3 on: July 25, 2007, 04:19:59 am »
 >:( >:( >:( >:( >:( GRRRRRRRR

Paolo,

The amount of information lost in converting changing a classifier to an interface contract  ........


bruce
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Can you convert a class to an interface?
« Reply #4 on: July 25, 2007, 01:55:03 pm »
Quote
>:( >:( >:( >:( >:( GRRRRRRRR

Paolo,

The amount of information lost in converting changing a classifier to an interface contract  ........


bruce
Notwithstanding your excellent point (one shouldn't change a class to an interface willy nilly),
if EA got it wrong, it has to be corrected...  Typically, this is done really early in the process - so there's not much loss.

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

Andrew_F

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Can you convert a class to an interface?
« Reply #5 on: July 25, 2007, 10:10:19 pm »
Quote
Notwithstanding your excellent point (one shouldn't change a class to an interface willy nilly),
 if EA got it wrong, it has to be corrected...  Typically, this is done really early in the process - so there's not much loss.

Paolo


Ok...and I will only ever reverse Engineer those Interfaces (source-> Model) when they change, as they are external code.
Fortunately a reverse engineer after they've changed to interfaces, leaves them as interfaces and imports any changes.