Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UML component diagram for Python code: How to illustrate difference between classes and modules?

I need to draw an UML component diagram for my code / a scientific paper. My Python project consists of a few different files (modules) and also some classes. How do you illustrate this in a UML component diagram? Do i have to use different connectors depending on the "types" of the "components"?

Let's say there are the following 'components':

  1. Service (class)
  2. PdfCreator (class)
  3. calc_utils (module)

1 . interacts with 2. and 3.

like image 421
till31 Avatar asked Dec 06 '25 18:12

till31


1 Answers

Basically a Python class corresponds to a UML class. A Python module can just be seen as UML component containg a set of classes. You are free to show the contained classes and/or to show interfaces with the component. Probably for Python the latter is less appropriate. You can use dependency from a class to show that it needs a module. Here you can especially utilitze «use» relations.

enter image description here

like image 63
qwerty_so Avatar answered Dec 08 '25 06:12

qwerty_so