|
CodingGuidelines
Here are the rules of the road for contributing code to the project. Let's follow this process so that we don't duplicate effort and so the code base is easy to maintain over the long haul.
Subversion RepositoryThe official Subversion repository for Wheels is located at our Google Code site. Anyone may check out a read only copy of the code using this command: svn checkout http://cfwheels.googlecode.com/svn/trunk/ cfwheels-read-only The repository contains a standard SVN structure.
Core Team Has Write AccessTo make sure that we don't have too many chefs in the kitchen, we will be limiting SVN write access to a core team of developers. At this time, the core team consists of these developers:
This does not restrict you from being able to contribute. See "Process for Implementing Changes to the Code" below for instructions on volunteering. With enough dedication, you can earn a seat on the core team as well! Process for Implementing Changes to the CodeHere's the process that we'd like for you to follow. This process is in place mainly to encourage everyone to communicate openly. This gives us the opportunity to have a great peer-review process, which will result in quality. Who doesn't like quality?
Code StyleAll framework code should use the following style. This will make things more readable and will keep everyone on the same page. If you're working on code and notice any violations of the official style, feel free to correct it! Additionally, we recommend that any applications written using the Wheels framework follow the same style. This is optional, of course, but still strongly recommended. Supported CFML EnginesAll code for Wheels should be written for use with Adobe ColdFusion 8 and Railo 3.1. Naming ConventionsTo stay true to our ColdFusion and Java roots, all names must be camelCase. In some cases, the first letter should be capitalized as well. Refer to these examples.
CFC ConventionsLocal VariablesEveryone doing OOP with ColdFusion loves all of the the room for error that the var keyword allows! To help eliminate confusion, define a local struct at the top of CFC methods called loc. Any variable whose value should not persist for the life of the CFC instance should be stored in the loc struct. The only exception to this rule is when a function only uses one variable, in which case that variable alone can be declared with the var keyword. For example: <cffunction name="someMethod" access="public" returntype="void">
<cfargument name="someArgument" type="string" required="true">
<cfset var loc = {}>
<cfset loc.someVariable = true>
<cfloop array="variables.someArray" index="loc.i">
<!--- Some code --->
</cfloop>
</cffunction>CFC MethodsAll CFC methods should be made public. If a method is meant for internal use only and shouldn't be included in the API then prefix it with a dollar sign $. An example would be $query(). |
Sign in to add a comment