gildir has asked for the wisdom of the Perl Monks concerning the following question:
Fellow monks,
I have decided to start documenting my project at last and was hoping to use UML class diagrams for visualization of class relations in my code. But I just can't figure up how I should write perl function prototypes and data types into UML class diagram.
Let's have method foo:
Which one of these should I use?sub foo { my ($self,$date,$message,$opt_args) = @_; ..... return $sucess; }
- +foo(date: scalar, message: scalar, opt_args: hashref): scalar
- +foo($date: Date, $message: String, $opt_args: Hash): boolean
- +foo($date: String, $message: String, $opt_args: \Hash): boolean
And things starts to get even more weird when 'standard' OO constructor calling convention takes place:
Should this be written as new(%args: Hash): \Class or new(foo: String, bar: String): Class or just new(args: Hash)?sub new { my ($class,%args) = @_; ... my $foobar = $args{foo} . $args{bar}; # Whatever ... }
Please, help poor confused monk to find a stream of light in darkness. Any suggestion appreciated.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl UML conventions
by Beatnik (Parson) on May 17, 2001 at 14:01 UTC | |
by Dumu (Monk) on Mar 02, 2015 at 14:05 UTC | |
by Anonymous Monk on Feb 10, 2018 at 10:11 UTC | |
by Anonymous Monk on Feb 10, 2018 at 11:04 UTC | |
Re: Perl UML conventions
by jorg (Friar) on May 17, 2001 at 15:58 UTC | |
by gildir (Pilgrim) on May 17, 2001 at 16:23 UTC | |
by DrZaius (Monk) on May 17, 2001 at 18:53 UTC | |
Re: Perl UML conventions
by gregor42 (Parson) on May 17, 2001 at 18:49 UTC | |
Re: Perl UML conventions
by thargas (Deacon) on Mar 02, 2015 at 18:44 UTC |
Back to
Seekers of Perl Wisdom