StarUML defining interface methods and attributes in the interface icon?
Asked Answered
D

1

19

I'm just using StarUML to create my UML Class diagram and something is bothering me. I create an interface representation, which is a circle, however, there is no room to add which methods and attributes the interface defines. Is this normal UML practice?

If not, how do you know (say a class implements this interface and has 4 methods defined) which of the 4 methods came from the interface and which didnt?

Solved:

Ok just incase someone else has this problem- there are two notations, both are possible in StarUML but only one explicitly (the dot notation). To create the <> notation, enter the name as <> IInterface_Name and then draw a realisation line between the implementing classes. Be sure to manually delete the old (wrong) relationship you had by right clicking the class, collection editor and then relations.

Dongdonga answered 22/7, 2011 at 11:10 Comment(0)
P
47

It is very simple:

  1. If you need just show method of interface - right click on interface and un-select Format/Suppress operation (see blue circle on picture)
  2. If you need to display instead of circle just squared form of interface (on my picture it is ISome) use Format/Stereotype Display/Decoration (see red circle on picture bellow)

enter image description here

Prima answered 22/7, 2011 at 11:27 Comment(7)
Thanks, i found another way- just to show the non-dot notation method, along with a realisation associationDongdonga
Thanks, I had the same issue and didn't know you could change the shape. However it won't let me add any method declarations to the Interface. I've tried 'Add > Operation' but it just does nothing. How did you add the Operation2 to your ISome? I'm using v2.0.0 mac.Melanite
DOH! You already answered that in point 1. I hadn't unticked Suppress Operations. Serious case of RTFSO.Melanite
Coming a bit too late to the party but wondered if it is possible to make it default interface to be drawn in squared <<interface>> shape... This should be standard no? I was surprised to see circle for interfaceDuque
@Duque may be I don't get you question right, but if mean "Can I change <<interface>> onto smthng else" - then yes, you can. It is called stereotype. For some reason StarUML allows modify it for regular classes, but Interfaces are displayed with fixedPrima
on your screenshot I see it under menu as circle, and next to it,not covered ISome with Operation2(), is how I would expect interface to be represented by default (instead of default circle that StarUML offers)Duque
@Duque - yes, go to Menu\Tools\Options, select Environment\Specific View and scroll to "Interface View". For my version I can see "Show Stereotype = Icon" (or whatever you select)Prima

© 2022 - 2024 — McMap. All rights reserved.