Sparx Systems Forum
Enterprise Architect => Uml Process => Topic started by: royd 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?
-
I'm a little confused by EA when it comes to modelling interfaces within a class diagram.
I will try to help...
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.
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.
and all attributes seem to be set to static.
Correct. You cannot create an instance of an interface, so it can't own attributes.
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