Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Generate UML from Perl code?

( #102364=categorized question: print w/ replies, xml ) Need Help??
Contributed by marvi on Aug 06, 2001 at 03:59 UTC
Q&A  > object-oriented programming


Description:

Is there a tool that generates UML diagrams from Perl source code?

Answer: Generate UML from Perl code?
contributed by Zaxo

Super Search here yields two root nodes asking this ('UML' in both title and text):

  1. UML for PERL?
  2. Perl UML conventions

A perl interface to Dia looks especially promising

Answer: Generate UML from Perl code?
contributed by htoug

Simon Johnston <sjohnsto@rational.com> has written a Perl AddIn for Rose. He talked about it at TPC4. You can find it at: http://www.rationalrose.com/addins/RosePerl-1_0_1.htm

Answer: Generate UML from Perl code?
contributed by bikeNomad

The code I posted at Graph your Perl inheritance structure will draw an inheritance diagram from an existing Perl program. You should be able to modify it to make UML diagrams pretty easily. But you won't be able to edit them graphically.

But you don't say what UML diagrams you're interested in (there are lots of different kinds). Some possibilities that I can think of for diagramming:

  • use the debugger hooks to build a sequence or collaboration diagram
  • analyze the @ISA structure for a class diagram like my example does
  • analyze your POE structures for a class diagram
  • analyze the 'use' and 'require' structures (you can use the debugger hooks here too) for a component diagram
Answer: Generate UML from Perl code?
contributed by stajich

Another good option is AutoDia which will produce XML suitable for the Dia drawing program. Typically you'll need to so some editing of the diagram after generation, but it seems to get the inheritance down okay. I like it as a starting point rather than building the whole class hierarchy by hand.

Please (register and) log in if you wish to add an answer



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (12)
    As of 2014-08-21 20:51 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (143 votes), past polls