Book a Demo

Author Topic: Modelling Interfaces in EA confusion!  (Read 5664 times)

royd

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Modelling Interfaces in EA confusion!
« on: March 21, 2005, 03:21:03 am »
Hi,
I'm a little confused by EA when it comes to modelling interfaces within a class diagram. There seems to be different behaviour between creating a class (i.e. dragging a class from the toolbar) and setting a stereotype of <<interface>> and creating an interface (dragging an interface from the toolbar).
When doing the latter the only way of adding attributes and operations seems to be via a right click and all attributes seem to be set to static. Also when generating C# from the model only the former method seems to create the interface members correctly.
What's the recommended method for creating an interface class that looks right and forward engineers correctly? Am I missing something?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Modelling Interfaces in EA confusion!
« Reply #1 on: March 22, 2005, 04:42:38 pm »
Quote
I'm a little confused by EA when it comes to modelling interfaces within a class diagram.

I will try to help...

Quote
There seems to be different behaviour between creating a class (i.e. dragging a class from the toolbar) and setting a stereotype of <<interface>> and creating an interface (dragging an interface from the toolbar).

Only the latter is an interface, as UML understands the term.

Quote
When doing the latter the only way of adding attributes and operations seems to be via a right click

Try F9 for attributes, F10 for operations.

Quote
and all attributes seem to be set to static.

Correct. You cannot create an instance of an interface, so it can't own attributes.

Quote
Also when generating C# from the model only the former method seems to create the interface members correctly. What's the recommended method for creating an interface class that looks right and forward engineers correctly? Am I missing something?

Sorry I don't know C# so can't comment. Try reverse-engineering a C# interface and see what EA does with it.

Hope this helps,

Neil
The Sparx Team
[email protected]