Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UML Class Diagram and Generics

Tags:

java

uml

How do you indicate a generic class or interface in a Class Diagram?

I'm looking for two things really:

  1. One is how do I model generic java classes if i were doing it with pen and paper.
  2. Secondly, what uml tools out there support generic classes/interfaces.

Thanks!

like image 346
Karthik Ramachandran Avatar asked Jan 24 '11 20:01

Karthik Ramachandran


People also ask

How do you represent a generic class in UML?

Secondly, what uml tools out there support generic classes/interfaces. Use http://staruml.io/. Really nice tool, you can manage all project diagrams in one place. At right top corner, there is object/diagram tree, so you can use same classes(other objects) at different diagrams.

What is difference between class and generic class?

The generic class works with multiple data types. A normal class works with only one kind of data type.

Is class diagram and UML same?

In software engineering, a class diagram in the Unified Modeling Language (UML) is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, operations (or methods), and the relationships among objects.


1 Answers

Usually generics are represented as classifier's template parameter. Here is the example how it looks like in the NetBeans UML Plugin:

enter image description here

like image 115
Vitalii Fedorenko Avatar answered Sep 24 '22 06:09

Vitalii Fedorenko