Devel::Diagram - Discover the classes of an arbitrary suite of Perl modules
use Devel::Diagram; # Discover classes of a package anchored by a single Perl module. # $diagram = new Devel::Diagram('CGI'); # Discover classes of a package anchored by a collection of modules in a folder. # use Devel::Diagram; $diagram = new Devel::Diagram('HTML/'); # Render the result in your desired format. # print $diagram->Render('UXF20'); # Render the result, then transform it via XSL. # print $diagram->Render('UXF20', 'xsl:uxf20toHtml');
Devel::Diagram scans the given Perl modules attempting to discover the class structure. It produces a hash table that can be converted to XML (or other formats) via Render().
An XSL stylesheet is included that converts the XML class diagram into HTML.
eg/Diagram.pl for a full example of use.
The few methods you need to activate Devel::Diagram.
Here you name the Perl module (or suite) you want to process. Enter the string you would specify in a 'use' or 'require' statement for this module.
You may enter as many module specifications as you like, separated by commas.
Renders the class diagram in the given format. Currently the only format that is recognized is 'UXF20'. These can be extended easily by creating a new
Render() optionally takes a second parameter specifying a transformation on the rendered format, presumably resulting in a new format. For instance,
renders the class diagram as UXF20, then runs it through the XSL transform named
Render() expects to find the XSL stylesheet in the
xsl folder of
Devel::Diagram. You need
XML::XSLT::Wrapper and an appropriate XSL transform engine to make this work.
Any warnings or errors in the rendering process can be found by investigating
$@ on return.
These are some of the things I think can be done to extend Devel::Diagram.
UXF is the only XML format supported.
XMI is another commonly used format (but more complex).
Class::Struct is also used to code OO Perl. Need to recognize this structure in the codebase. There are also several other modules for class creation.
What are the parameters of the operations?
The is more than one way to do it. OO Perl can be implemented in many ways; Devel::Diagram recognizes a few of them. CPAN is big, really big, so there are OO Perl techniques that Devel::Diagram will not recognize, yet.
Collaboration, sequence, etc. (see
Devel::Diagram is written and maintained by Glenn Wood, http://search.cpan.org/search?mode=author&query=GLENNWOOD.
Copyright (c) 2003 Glenn Wood All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.