Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

StarUML Class Diagram : How to manually add Generics (Template Type T) for a class

Below is the image to show a Generic class of Type T in the UML Class Diagram.

I could not figure out how to add the T Template Box on top of Generic Class (set in the Image) using Star UML.

Is there any way in Star UML to add this Generic Type T box on top of a Generic class?

For the Derived Classes of this Generic Base Class, I have already added <<bind>> stereotype with the types that they use.

enter image description here

like image 615
Guna Avatar asked Jun 05 '15 05:06

Guna


People also ask

How do you add multiplicity to a class diagram in Staruml?

Mouseover one of the square blocks at the end of the line so you get the hand cursor and double-click. You then will see a pop-up with a combobox dropdown menu on the right side. Select the multiplicity from the dropdown menu, multiplicity can be selected from: 0..1, 1, 0.., 1.., and * or entered directly.

How do you add a link in Staruml?

You can enter a link for a model element or a URL. To link a model element, click reference property in Property Editor and select a model element to link in Element Picker Dialog. Or to link a URL, enter full URL in url property (e.g. https://staruml.io ).

What is template parameter in UML?

In UML models, templates are model elements with unbound formal parameters that you can use to define families of classifiers, packages, and operations. A template is a parameterized model element that describes or identifies the pattern for a group of model elements of a particular type.


1 Answers

I'm using version 2.7.0, and you can add Template Parameter to the target class to indicate Generics.

Details: After you add a class or an interface, right click the diagram, and then choose Add->Template Parameter. You can edit the template parameter(or generic type) at the top-right of your class or interface.

like image 70
Lym Zoy Avatar answered Sep 22 '22 00:09

Lym Zoy