UML to Python/Java code generation

M

Maurice LING

Hi,

Is there any UML tools that is able to take UML and generate Python codes?

Cheers
Maurice
 
P

Paul McGuire

Enterprise Architect (http://www.sparxsystems.com.au/) supports an
add-in that will generate Python from UML diagrams. Once you install
EA, follow the instructions for adding the Python technology resource,
which is a free download from the EA website.

Will also generate UML from Python source.

You'll need to buy the Professional Edition to get code import/export,
US$189, but it is an excellent tool!

-- Paul
 
J

James

Is there any UML tools that is able to take UML and generate Python codes?

Dia2code generates Python from UML.
Boa Constructor generates UML from Python.
PyUt.
Object Domain's UML Tool (Commercial)

You need to use Google.
 
M

Maurice LING

Thanks James. I've googled a few times and it is always tools that
generates UML from Python codes that comes up in the top hits, which
brings me to wonder if there is something that does the opposite.

maurice
 
J

James

Peter said:
The best is human brain.

No! It isn't. In fact, it's the worst.

The brain may be fine for generating Python from UML but it is MANY
MANY orders of magnitude harder to generate UML from code with just
your brain than using a tool (usually zero effort and error free) no
matter how good you are at Python.
 
M

Magnus Lycka

James said:
The brain may be fine for generating Python from UML but it is MANY
MANY orders of magnitude harder to generate UML from code with just
your brain than using a tool (usually zero effort and error free) no
matter how good you are at Python.

I've really only used Rational Rose, but that tool is
really limited in both directions. Class structure to
class diagrams work both ways (not for Python, but for
Java and C++ at least) but that's just a tiny part of
UML.

I don't expect any tool to do anything meaningful about e.g.
use case diagrams, but what about activity diagrams, sequence
diagrams, collaboration diagrams and state diagrams?

I agree that the brain is poor at such things, but I doubt
that any current tool is much better except for trivial
subsets of UML.
 
M

Mike P.

Magnus Lycka said:
I've really only used Rational Rose, but that tool is
really limited in both directions. Class structure to
class diagrams work both ways (not for Python, but for
Java and C++ at least) but that's just a tiny part of
UML.

I don't expect any tool to do anything meaningful about e.g.
use case diagrams, but what about activity diagrams, sequence
diagrams, collaboration diagrams and state diagrams?

I agree that the brain is poor at such things, but I doubt
that any current tool is much better except for trivial
subsets of UML.

Have a look at Enterprise Architect from Sparx Systems
(http://www.sparxsystems.com.au).
It is a really nice UML tool that is also affordable. I have also used
Rational Rose since about 96-97, and although it doesn't have Python support
for code generation, it most likely isn't a huge job to modify one of the
existing code generation templates (say the Java one) to generate Python
from the class diagrams.

Enterprise Architect has a separate free downloadble plug-in which can
generate Python.
See: http://sparxsystems.com.au/resources/mdg_tech/

Enterprise Architect is also much cheaper than Rose, and they can both do
C++ and Java.

Also, both of these tools have VBA/COM interfaces. What this means is that
you can control them and read data directly from them using the win32 python
extension models.

I haven't tried it with EA, but a couple of years ago I wrote Python scripts
that controlled Rose.
I did stuff like creating UML diagrams on the fly including changing colours
and shapes, and also reading data from UML models. The Rose Extensibility
Interface (REI) is very well documented.

One could potentially write Python scripts coupled with some Python
introspection/reflection code to automatically generate and reverse engineer
(and document) Python <-> UML. It was always something I wanted to do but
never got around to it.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,230
Latest member
LifeBoostCBD

Latest Threads

Top