Changes between Initial Version and Version 1 of DevelopmentGuidelines


Ignore:
Timestamp:
Feb 7, 2011, 4:09:10 PM (9 years ago)
Author:
jannekevdp@…
Comment:

moved from nbic wiki

Legend:

Unmodified
Added
Removed
Modified
  • DevelopmentGuidelines

    v1 v1  
     1== JavaScript ==
     2* JavaScript is stored in /js/
     3* to reduce browser overhead we ''only'' use the jQuery JavaScript framework (so ''no'' mootools, yui, prototype, etc). jQuery is widely used by Google, Amazon, Microsoft, IBM, Twitter, etc... More information can be found [http://grails.org/jQuery+Plugin here].
     4* for fancy user interface widgets such as accordion or tabs, we use jQuery ui (http://jqueryui.com/). Currently the CSS and JS of jQuery UI 1.7.2 (theme Pepper Grinder) are put into the /js/ and /css/jquery-ui/ folders. To use for example the accordion widget for a div with id 'idAcc' in you GSP, specify in head:
     5{{{
     6      <g:javascript library="jquery"/>
     7      <link rel="stylesheet" href="${createLinkTo(dir:'css/jquery-ui', file: 'jquery-ui-1.7.2.custom.css')}">
     8      <script src="${createLinkTo(dir: 'js', file: 'jquery-ui-1.7.2.custom.min.js')}" type="text/javascript"></script>
     9      <script type="text/javascript">
     10        $(function() {
     11                $("#idAcc").accordion();
     12        });
     13      </script>
     14}}}
     15
     16== Authentication ==
     17
     18We use Nimble (which is in it's turn based on Apache Shiro): http://sites.google.com/site/nimbledoc/home (License: Apache 2.0). Authentication tags can be found at http://sites.google.com/site/nimbledoc/developer-documentation/authentication-and-access-control-tags-supplied-by-nimble.
     19
     20== Images ==
     21* images are stored in /images/* and images should be grouped in logically named directories (for example: /images/icons/famfamfam/*)
     22* whenever images are used, optimize them for the web (in Photoshop: file --> Save for Web & Devices --> jpeg 80%)
     23
     24== IDE ==
     25* we develop using the [http://www.netbeans.org/downloads/index.html NetBeans IDE] tightly integrates with Groovy & Grails (install the Groovy & Grails plugin)
     26[[Image:Screen shot 2009-11-02 at 3.35.26 PM.png]]
     27
     28== Tabs & Indentation ==
     29* use the following settings for tabbing and indentation
     30[[Image:Screen shot 2009-11-02 at 3.10.53 PM.png]]
     31
     32== Subversion commits ==
     33* Commit logical changesets
     34* When you commit a change to the repository, make sure your change reflects a single purpose: the fixing of a specific bug, the addition of a new feature, or some particular task. Your commit will create a new revision number which can forever be used as a "name" for the change.
     35* if you break the repository you have to get cake!
     36
     37== Naming conventions ==
     38* In Java, naming conventions for identifiers have been established and suggested by various Java communities such as Sun Microsystem<ref>"Code Conventions for the Java Programming Language", [http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html Section 9: "Naming Conventions"]</ref>, Netscape<ref>"NETSCAPE'S SOFTWARE CODING STANDARDS GUIDE FOR JAVA",[http://collaboratory.emsl.pnl.gov/docs/collab/sam/CodeStandards.html Collab Software Coding Standards Guide for Java]</ref>, AmbySoft<ref>"AmbySoft Inc. Coding Standards for Java v17.01d", [http://www.ambysoft.com/essays/javaCodingStandards.html]</ref> and etc. A sample of naming conventions set by Sun Microsystem are listed below:
     39{| class="wikitable" border="1"
     40|-
     41! Identifier Type
     42! Rules for Naming
     43! Examples
     44|-
     45| Classes
     46| Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML).
     47| class Raster;
     48class ImageSprite;
     49|-
     50| Methods
     51| Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.
     52| run();
     53runFast();
     54getBackground();
     55|-
     56|Variables
     57|Except for variables, all instance, class, and class constants are in mixed case with a lowercase first letter. Internal words start with capital letters. Variable names should not start with underscore _ or dollar sign $ characters, even though both are allowed.
     58
     59Variable names should be short yet meaningful. The choice of a variable name should be mnemonic- that is, designed to indicate to the casual observer the intent of its use. One-character variable names should be avoided except for temporary "throwaway" variables. Common names for temporary variables are i, j, k, m, and n for integers; c, d, and e for characters.
     60|int             i;
     61char            c;
     62float           myWidth;
     63|}
     64
     65Note: while class names start with an uppercase character, instances of classes are variables and hence start with a lowercase character.
     66
     67[[Category:GSCF]]