[Tutor] How to go about describing my software with a component diagram?

Alan Gauld alan.gauld at yahoo.co.uk
Thu Dec 26 07:20:43 EST 2024


On 24/12/2024 21:05, marc nicole via Python-list wrote:
> I want to convey the idea that main.py (main algorithm) imports 3 modules
> (V, S, M) (each of them containing .py scripts related to
> different functionalities) and use their methods accordingly as per the
> requirement: basically the structure of my code and how the modules relate
> to each other.

Assuming you are thinking about UML notation a component diagram
is probably the wrong tool. Components are normally used for
physical entities - source files, libraries, executables etc.
You probably want to use a package diagram to express the
logical connection between modules and algorithms(ie functions?)
This allows you to show which modules contain which algorithms
and which modules use other modules etc.

Trying to mix physical and logical entities within a single
diagram will just lead to confusion.

If it really is the physical architecture you want to show,
you can represent your algorithm interfaces using "lollipop"
notation on the containing component. This is mainly useful
where multiple components depend on a common component, say,
but each dependency uses different interfaces (COM v Web
service v Socket etc).

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos





More information about the Tutor mailing list