NAME
UML::Sequence::SimpleSeq - turns simple outlines (see below) into UML sequence diagrams
SYNOPSIS
genericseq.pl UML::Sequence::SimpleSeq outline_file > sequence.xml
seq2svg.pl sequence.xml > sequence.svg
OR
genericseq.pl UML::Sequence::SimpleSeq outline_file | seq2svg.pl > sequence.svg
DESCRIPTION
This file may be used directly by a script (as shown above) or as a base class for other sequencers (see UML::Sequence::JavaSeq). It supplies routines for handling simple outlines like a user could be expected to type by hand. Such outlines look like this:
At Home.Wash Car
Garage.retrieve bucket
Kitchen.prepare bucket
Kitchen.pour soap in bucket
Kitchen.fill bucket
Garage.get sponge
Garage.open door
Driveway.apply soapy water
Driveway.rinse
Driveway.empty bucket
Garage.close door
Garage.replace sponge
Garage.replace bucket
The "class" name and "method" name are separated by a dot. If there are multiple dots, the method name is everything after the last dot. Classes and methods in this context are elements of a UML sequence diagram. Classes get boxes at the top of the page. Method calls are labeled lines from one class to another. If you want two classes with the same name, you must append a suffix or prefix (try instanceName:ClassName).
grab_outline_text
Call this first with the outline file (in the format described above). Pass it the name of the file to read. Returns a reference to an array whose elements are lines from the outline with spacing preserved.
grab_methods
Call this with an outline (possibly generated by grab_outline). It will return a hash reference. Each method mentioned in the outline will appear as a key in the hash (the values are less important, they count the occurances of the method).
parse_signature
This method is a call back used by the UML::Sequence constructor. It accepts a signature and returns the "class" name (in scalar context) or the "class" and "method" names (in list context). It splits the signature on the last dot it sees after removing any argument list and associated parentheses. Thus, it works for simple and Java outlines.
AUTHOR
Phil Crow, <philcrow2000@yahoo.com>
COPYRIGHT
Copyright 2003, Philip Crow, all rights reserved. You may modify and/or redistribute this code in the same manner as Perl itself.