UML <-> Python

Roman Suzi rnd at
Thu Jun 7 15:09:19 EDT 2001


It occured to me that probably Python language has some abilities
which couldn't be expressed in UML.

For example:

0. How to express that object attributes can be added "on the fly"?

1. In Python it is possible to pass modules/packages as arguments.
How to express this on static-model diagram?

2. Python's signature-based polymorphism is probably too "amorphic" to
express with usual class boxes. But is it appropriate to use interfaces to
describe this better? (interfaces aren't explicit in Python).

3. Some mighty features of Python coming from functional programming and
used to organize conveyers of operations within containers couldn't (IMHO)
adequately expressed by UML, because they are SIMD (single instruction,
multiple data) things.

It could be also interesting to hear the opposite: which UML diagrams (or
their aspects) couldn't be directly applied in Python. For example, I have
a feeling Python isn't very proficient in hiding details of threading.
(Some modules are not thread-safe).

Another point is that Python doesn't have language-level support
for "private" and "protected" properties (not to mention types).

OK, I am only started to learn UML and probably my questions are
silly, but it seems UML is much more into C++/Java and imposes
more constraints on design than Python.

Has anybody out of pure curiosity to take UML description
of some "serious" project (implemented in "serious" languages
like C++ or Java) and try to implement most difficult
parts in "named-after-the-comic-show" language ;-)

What was the result?

(I myself had pleasure to rewrite Perl programs in Python
and once it even saved us from remote exploit. But that
was not very serious scripts).

Sincerely yours, Roman Suzi
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at _/
_/ Thursday, June 07, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "Anything not nailed down is a cat toy." _/

More information about the Python-list mailing list