X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FStyleGuide.pod;h=ff9a1b5d00a7059922c3afb22db377ec0e10269b;hb=3a17b276638200475d54201fa62566b7440e819a;hp=4a45e8205dd2cf5ea543f3f5eabc6bee20c4b066;hpb=5fc8c5edf574ab024d4646914b6432d458e2ffbd;p=freeside.git diff --git a/rt/lib/RT/StyleGuide.pod b/rt/lib/RT/StyleGuide.pod index 4a45e8205..ff9a1b5d0 100644 --- a/rt/lib/RT/StyleGuide.pod +++ b/rt/lib/RT/StyleGuide.pod @@ -40,10 +40,8 @@ We hope to add any significant changes at the bottom of the document. =head2 Perl Version -We code everything to perl 5.6.1. Some features require advanced unicode -features in perl 5.8.0. It is acceptable that unicode features work only for -US-ASCII on perl 5.6.1. - +We code everything to perl 5.8.3 or higher. Complete unicode support +requires bugfixes found in 5.8.3. =head2 Documentation @@ -239,7 +237,27 @@ leads to cleaner code. my $var1 = shift; # right my $var2 = shift; +=head2 Method parameters + +If a method takes exactly one mandatory argument, the argument should be +passed in a straightforward manner: + + my $self = shift; + my $id = shift; + +In all other cases, the method needs to take named parameters, usually +using a C<%args> hash to store them: + my $self = shift; + my %args = ( Name => undef, + Description => undef, + @_ ); + +You may specify defaults to those named parameters instead of using +C above, as long as it is documented as such. + +It is worth noting that the existing RT codebase had not followed this +style perfectly; we are trying to fix it without breaking exsiting APIs. =head2 Tests @@ -857,7 +875,28 @@ is a good chance it will not be dealt with. Send patches to rt--bugs@fsck.com, too. Use C for patches. +=head1 SCHEMA DESIGN + +RT uses a convention to denote the foreign key status in its tables. +The rule of thumb is: + +=over 4 + +=item When it references to another table, always use the table name + +For example, the C