Version 1 (modified by jannekevdp@…, 3 years ago)

moved from nbic wiki

JavaScript?

* JavaScript? is stored in /js/ * 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  here. * 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:

      <g:javascript library="jquery"/>
      <link rel="stylesheet" href="${createLinkTo(dir:'css/jquery-ui', file: 'jquery-ui-1.7.2.custom.css')}">
      <script src="${createLinkTo(dir: 'js', file: 'jquery-ui-1.7.2.custom.min.js')}" type="text/javascript"></script>
      <script type="text/javascript">
	$(function() {
		$("#idAcc").accordion();
	});
      </script>

Authentication

We 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.

Images

* images are stored in /images/* and images should be grouped in logically named directories (for example: /images/icons/famfamfam/*) * whenever images are used, optimize them for the web (in Photoshop: file --> Save for Web & Devices --> jpeg 80%)

IDE

* we develop using the  NetBeans IDE tightly integrates with Groovy & Grails (install the Groovy & Grails plugin) [[Image:Screen shot 2009-11-02 at 3.35.26 PM.png]]

Tabs & Indentation

* use the following settings for tabbing and indentation [[Image:Screen shot 2009-11-02 at 3.10.53 PM.png]]

Subversion commits

* Commit logical changesets * 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. * if you break the repository you have to get cake!

Naming conventions

* 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",  Section 9: "Naming Conventions"</ref>, Netscape<ref>"NETSCAPE'S SOFTWARE CODING STANDARDS GUIDE FOR JAVA", 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: {| class="wikitable" border="1" |- ! Identifier Type ! Rules for Naming ! Examples |- | Classes | 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). | class Raster; class ImageSprite?; |- | Methods | Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized. | run(); runFast(); getBackground(); |- |Variables |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.

Variable 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. |int i; char c; float myWidth; |}

Note: while class names start with an uppercase character, instances of classes are variables and hence start with a lowercase character.

[[Category:GSCF]]

Attachments