Index: openacs-4/packages/acs-core-docs/www/eng-standards-plsql.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/eng-standards-plsql.html,v diff -u -r1.8.2.8 -r1.8.2.9 --- openacs-4/packages/acs-core-docs/www/eng-standards-plsql.html 4 May 2003 06:30:02 -0000 1.8.2.8 +++ openacs-4/packages/acs-core-docs/www/eng-standards-plsql.html 7 May 2003 17:40:58 -0000 1.8.2.9 @@ -1,5 +1,5 @@ -PL/SQL Standards

PL/SQL Standards

+PL/SQL Standards

PL/SQL Standards

By richardl@arsdigita.com and yon@arsdigita.com


@@ -12,7 +12,7 @@ our product will be useful long after the current people building and maintaining it are around. Following are some standards and guidelines that will help us achieve this goal: -

General

  1. +

    General

    1. All PL/SQL code must be well documented. We must write code that is maintainable by others, this is especially true in our case because we are building an open source toolkit than anyone can @@ -24,7 +24,7 @@ as is possible given the nature of team development. This means carrying style and other conventions suchs as naming within an application, not just within one file. -

    Code

    1. +

    Code

    1. Encapsulation of related fuctionality is key to maintainability and upgradeability of our software. Try to bundle your code into packages @@ -55,13 +55,13 @@ show errors

    2. - Always use create or replace procedure|function + Always use create or replace procedure|function <proc_or_func_name>. It makes reloading packages much easier and painless to someone who is upgrading or fixing a bug.

    3. - Always qualify end statements, i.e., the - end statement for a package should be end - <package_name>;, not just end;; same + Always qualify end statements, i.e., the + end statement for a package should be end + <package_name>;, not just end;; same goes for procedures, functions, package bodies, and triggers.

    4. Always use the "show errors" SQL*Plus command after each PL/SQL @@ -73,11 +73,11 @@ the v_* and *_in syntax in favor of named parameters notation:

       
      -      
      +      
               acs_user.create(first_names => 'Jane', last_name => 'Doe', etc.)
             
               instead of
      -      
      +      
               acs_user.create(first_names_in => 'Jane', last_name_in => 'Doe', etc.)
             
            
      @@ -120,11 +120,11 @@
           Use 't' and 'f' for booleans, not the PL/SQL "boolean" datatype
           because it can't be used in SQL queries.
          

    5. - All new functions (e.g., acs_object.new, + All new functions (e.g., acs_object.new, party.new, etc.) should optionally accept an ID:

       
      -      
      +      
               create or replace package acs_object
               as
                   function new (
      @@ -138,12 +138,12 @@
            
           
       

      - takes the optional argument object_id. Do this to + takes the optional argument object_id. Do this to allow people to use the same API call when they are doing double click protection, that is, tehy have already gotten an - object_id and now they want to create the object with - that object_id. -

    Style

    + object_id and now they want to create the object with + that object_id. +

Style

Some general style guidelines to follow for the purpose of consistency across applications.