in UML, there seems to be no element that is the equivalent of a module in python, or at least I haven't figured it out yet.
a module in python represented by a single .py file has a header where imports are indicated. it can contain many classes, all classes are in the module namespace and can directly communicate with each other and have access to the packages / modules / classes that the module imported. how can i draw this on a chart?
update 1: finally, I came across a webpage where I found something that seems relevant ... on this site ( http://www.alan-g.me.uk/l2p/tutclass.htm ) in chapter "Mixing classes and modules" the author says:
"... We can represent this graphically in UML in two ways. The logical grouping of classes can be represented using the Package or we can represent the physical file as a component ..."
if correct, the module in python is similar to the component in UML. I'm still trying to understand how this can work (because the component in UML does not seem to me the same as the module in python), and how and in which diagram I can model it.
update 2: I am testing it with a visual paradigm (without creating code). at the moment, I was able to see that in the UML model, the component-element has a behavior similar to a folder, for example, a package. and when I hover over the classes that are contained in the component, I can see the effect I need, a component representing its own namespace.
now (if this is the correct way to model it), where can I indicate which other packages / modules / classes this module should import? when I select a package in the visual paradigm, it offers me the opportunity to import packages. but when I select a component, import functionality is not offered. Thanks a lot in advance.
source share