Changes between Version 14 and Version 15 of Documentation/DevelopmentCenter/DeveloperGuidelines
- Timestamp:
- 01/15/11 20:47:48 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Documentation/DevelopmentCenter/DeveloperGuidelines
v14 v15 8 8 9 9 == 2. Coding Standards == 10 HeuristicLab code should be conform to the guidelines described in [http://msdn.microsoft.com/en-us/library/ms229042.aspx Design Guidelines for Developing Class Libraries].10 !HeuristicLab code should be conform to the guidelines described in [http://msdn.microsoft.com/en-us/library/ms229042.aspx Design Guidelines for Developing Class Libraries]. 11 11 12 12 To ensure consistent formatting of the source code, developers should use identical settings for the Visual Studio Text Editor. The [attachment:"Visual Studio 2010 text editor settings.vssettings" appropriate settings] are attached to this page and should be imported in Visual Studio. … … 29 29 * Interfaces start with an `I` (e.g. `IItem`, `IOperator`). 30 30 * Abstract base classes are not suffixed by `Base` (e.g. `Item`, `Operator`, `Engine`). 31 * The name of each HeuristicLab plugin starts with `HeuristicLab`.31 * The name of each !HeuristicLab plugin starts with `HeuristicLab`. 32 32 * The name of a plugin has to be identical to the project name and the namespace of the plugin (e.g. `HeuristicLab.Data`). 33 * Project names a re suffixed with their major and minor version number (e.g. `HeuristicLab.Data-3.3`).33 * Project names and their output are suffixed with their major and minor version number (e.g. `HeuristicLab.Data-3.3`, `HeuristicLab.Data-3.3.dll`). 34 34 * Plugins can be structured hierarchically (e.g. `HeuristicLab.Operators` and `HeuristicLab.Operators.Programmable`). 35 35 * Sub-namespaces can be used to structure the source files in a plugin. 36 36 * Each plugin is represented by a component in Trac. 37 * The leading `HeuristicLab.` is omitted in Trac component names.37 * The leading string `HeuristicLab.` is omitted in Trac component names. 38 38 * Data components that correspond to a property should have the same name as the property and are not prefixed by `my` (e.g. in `Item` `filename` is the correct name for the data component of the `Filename` property and not `myFilename`). 39 39 40 A source code example of well formatted HeuristicLab code is available [wiki:DevelopersGuidelinesSourceExample here].40 A source code example of well formatted !HeuristicLab code is available [wiki:DevelopersGuidelinesSourceExample here]. 41 41 42 42 == 3. Versioning System == 43 Source code and other documents are kept in the HeuristicLab Subversion repository available at http://dev.heuristiclab.com/svn/hl/core. Anonymous read-only access is enabled. If you want to contribute toHeuristicLab and therefore need write access to the repository, please write an e-mail to support@heuristiclab.com.43 Source code and other documents are kept in the !HeuristicLab Subversion repository available at http://dev.heuristiclab.com/svn/hl/core. Anonymous read-only access is enabled. If you want to contribute to !HeuristicLab and therefore need write access to the repository, please write an e-mail to support@heuristiclab.com. 44 44 45 45 For an introduction to Subversion, please take a look at the free book [http://svnbook.red-bean.com/ Version Control with Subversion] and the [http://tortoisesvn.net/docs/release/TortoiseSVN_en/index.html Online Documentation] of the Subversion client [http://tortoisesvn.net/ TortoiseSVN]. … … 51 51 * contains all project documentation files (API documentation, license, presentations, etc.) 52 52 * `sources` 53 * contains solution files, scripts and applications required for building HeuristicLab53 * contains solution files, scripts and applications required for building !HeuristicLab 54 54 * plugin folders 55 * each HeuristicLab plugin has its own folder55 * each !HeuristicLab plugin has its own folder 56 56 * the folder name has to be identical to the name of the plugin (e.g. `HeuristicLab.Data`) 57 57 * each plugin folder contains sub-folders for each major and/or minor version of the plugin (e.g. `3.3`) … … 64 64 * the name of a feature/exploration branch has to be descriptive 65 65 * new plugins should be developed in a feature branch first 66 * before merging a branch into the trunk, a comprehensive code review has to be done by at least one of the HeuristicLab architects66 * before merging a branch into the trunk, a comprehensive code review has to be done by at least one of the [DevelopersTeam HeuristicLab architects] 67 67 * a developer who created a branch is responsible for deleting it again 68 68 * release branches 69 69 * are used to prepare release versions 70 70 * are used to store old versions of plugins 71 * the folder name of a release branch has to be identical to the major and minor version number (e.g. 3.1) (cf. [ wiki:DevelopmentGuidelines#Versioning Versioning])71 * the folder name of a release branch has to be identical to the major and minor version number (e.g. 3.1) (cf. [#a4.Versioning Versioning]) 72 72 * `tags` 73 * contain a folder for each HeuristicLab release bundle (tag)73 * contain a folder for each !HeuristicLab release bundle (tag) 74 74 * it is not allowed to commit to tags 75 * the folder name of a tag has to be identical to the whole version number (e.g. 3.1.0.304) (cf. [ wiki:DevelopmentGuidelines#Versioning Versioning])75 * the folder name of a tag has to be identical to the whole version number (e.g. 3.1.0.304) (cf. [#a4.Versioning Versioning]) 76 76 77 77 === 3.2. Guidelines for Working with the HeuristicLab SVN Repository === … … 82 82 * each commit message must contain the ticket number of the corresponding Trac ticket (e.g. "(!#1)") 83 83 * repository content 84 * the repository has to contain all files necessary for compiling HeuristicLab84 * the repository has to contain all files necessary for compiling !HeuristicLab 85 85 * automatically generated files (object files, assemblies, !AssemblyInfo.cs, etc.) are not stored in the repository 86 86 * files containing user specific settings are not stored in the repository (e.g. *.suo, *.user) … … 89 89 * each developer can create a new exploration branch at any time 90 90 * new release branches for a plugin can be crated by the head developer of that plugin only 91 * new tags are created by the head developer of HeuristicLab only91 * new tags are created by the head developer of !HeuristicLab only 92 92 93 93 == 4. Versioning == 94 All plugins and all release bundles of HeuristicLab have a version number following the schema `Major.Minor.Build.Revision`:94 All plugins and all release bundles of !HeuristicLab have a version number following the schema `Major.Minor.Build.Revision`: 95 95 * `Major` and `Minor` 96 * in order to distinguish from older versions of HeuristicLab (1.1 and 2.0), all plugins ofHeuristicLab 3.x should have a major version number greater or equal to 396 * in order to distinguish from older versions of !HeuristicLab (1.1 and 2.0), all plugins of !HeuristicLab 3.x should have a major version number greater or equal to 3 97 97 * when incrementing the major version number of a plugin, the minor version number has to be set back to 0 98 * the major and minor version numbers have to be included in the assembly name of each HeuristicLab assembly (e.g. `HeuristicLab.Data-3.3.dll`)98 * the major and minor version numbers have to be included in the assembly name of each !HeuristicLab assembly (e.g. `HeuristicLab.Data-3.3.dll`) 99 99 * all major and minor versions of a plugin are kept in the repository and have to be functional in order to assure backwards compatibility 100 100 * `Build` … … 105 105 * `Revision` 106 106 * represents the last revision, in which the component (assembly) has been changed or in which a version has been released 107 * when compiling assemblies the revision number is automatically extracted from the Subversion repository (cf. [ wiki:DevelopmentGuidelines#SubWCRev Automatic Extraction of the Current Revision Number])108 * when creating a new release bundle of the whole HeuristicLab system (tag) the revision number has to be set manually107 * when compiling assemblies the revision number is automatically extracted from the Subversion repository (cf. [#a4.1.SubWCRev Automatic Extraction of the Current Revision Number]) 108 * when creating a new release bundle of the whole !HeuristicLab system (tag) the revision number has to be set manually 109 109 110 110 === 4.1. Automatic Extraction of the Current Revision Number === #SubWCRev … … 131 131 * explanation of the information stored in each ticket: 132 132 * Status 133 * `new` 133 * `new` and `assigned` 134 * represent tickets that have just entered, but have not yet been picked up by a developer 135 * if the ticket is assigned a release milestone (such as e.g. `HeuristicLab 3.3.2`) the ticket appears as "Waiting for completion", otherwise it is part of the backlog 134 136 * each new ticket is assigned automatically to the developer of the corresponding component or manually to any other developer 135 * `assigned`136 * tickets that are assigned to another developer get the status `assigned`137 137 * `accepted` 138 138 * tickets that are currently processed by a developer get the status `accepted` 139 139 * the ticket status has to be set manually by the developer before starting to work on the ticket 140 * if working on a ticket is suspended for a longer period of time without closing the ticket, the status has to be reset to `assigned` (in that way it is assured that accepted tickets represent exactly those tickets, on which developers are currently working) 140 * if the ticket is assigned a release milestone, it appears under "Waiting for completion", otherwise it is "Under development" 141 * `reviewing` 142 * represents tickets of which the implemented work is being reviewed by another developer 143 * A completed ticket should be reviewed by another member of the time to ensure that the work is of high quality and the implemented solution is in accordance with the standards set by the team 144 * `readytorelease` 145 * represents tickets that are release-ready, meaning that the work was implemented, tested, and reviewed 146 * Tickets are only closed with "done" when a release is being made and remain open until the date of the release 141 147 * `closed` 142 148 * tickets which are resolved get the status `closed` 143 149 * developers have to provide an explanation for closing a ticket 144 * possible resolutions for closing a ticket are ` fixed` (work done), `invalid` (invalid ticket), `wontfix` (ticket will not be resolved), `duplicate` (another ticket has already been created for that issue), `worksforme` (issue could not be reproduced)145 * when closing a ticket with another explanation as `fixed`, the developer has to provide a comprehensive explanation146 * `reopened`147 * when a ticket is reopened again, the status is set to `reopened`148 * when reopening a ticket, the responsible developer is removed and the ticket has to be assigned again150 * possible resolutions for closing a ticket are `done` (the issue was resolved and released), `invalid` (the issue described is not an issue), `rejected` (the issue will not be resolved), `duplicate` (another ticket has already been created for that issue), `worksforme` (the issue could not be reproduced), and `obsolete` (the issue is outdated and no longer relevant) 151 * when a ticket is closed without being `done`, the developer has to provide a comprehensive explanation 152 * ~~`reopened`~~ 153 * the ability to reopen a ticket was removed 154 * if an issue was previously closed, but still remains an issue a new ticket should be created referencing the other one 149 155 * Type 150 156 * `defect` … … 157 163 * other (administrative) tasks which are not associtated with programming directly (e.g. generating documentation, creating release branches, etc.) 158 164 * Priority 159 * the following priorities are available to classify tickets: `blocker` (priority 1), `critical` (priority 2), `major` (priority 3), `minor` (priority 4), `trivial` (priority 5) 165 * the priority is used to rank the tickets in the backlog 166 * the following priorities are available to classify tickets: `highest` (priority 1), `high` (priority 2), `medium` (priority 3), `low` (priority 4), `lowest` (priority 5) 160 167 * classification of a ticket's priority has to be done by the user who reports the ticket 161 168 * Milestone 162 169 * a ticket has to be associated with a milestone 163 * milestones represent phases of the development of HeuristicLab 164 * usually a milestone is associated with the version of a HeuristicLab release bundle 170 * if the issue is targeted for release, it should be assigned a release milestone, otherwise the milestone `HeuristicLab x.x.x` should be chosen and it becomes part of the backlog 171 * milestones represent iterations in the development of !HeuristicLab 172 * usually a milestone is associated with the version of a !HeuristicLab release bundle 165 173 * Component 166 174 * a ticket has to be associated with a component (i.e. a plugin) 167 175 * the name of a component has to be identical to the name of the namespace or the plugin of that component (the leading "`HeuristicLab.`" is omitted) 176 * if no component is suitable or if the component is unknown `General` should be used 168 177 * Version 169 * each ticket has to be associated with a version number of HeuristicLab 170 * usually the version number corresponds to the milestone 178 * each ticket has to be associated with a version number of !HeuristicLab 179 * typically the ticket gets the version in which the described issue appeared 180 * the version of the ticket will be changed once the resolution is set to `done` to reflect the version in which the issue was fixed 181 * for exploration and prototyping, branches may be created and tickets may get the version `branch` indicating that the development is not affecting the trunk 171 182 172 183 == 6. Documentation == 173 184 === 6.1. Wiki === 174 The Trac wiki system is used for documenting the development of HeuristicLab. A description of the Trac wiki syntax is available at WikiFormatting.185 The Trac wiki system is used for documenting the development of !HeuristicLab. A description of the Trac wiki syntax is available at WikiFormatting. 175 186 176 187 === 6.2. Source Code === … … 179 190 Additionally, each type (class, enum, struct, etc.) and each public or protected method, property, or variable has to be documented using a C# XML comment. These comments are used to generate the API documentated using the tools [http://www.codeplex.com/Sandcastle Sandcastle] and [http://www.codeplex.com/SHFB Sandcastle Help File Builder]. A description of XML comments and several examples can be found at [http://msdn.microsoft.com/en-us/library/b2s063f7.aspx XML Documentation Comments] of the [http://msdn.microsoft.com/en-us/library/67ef8sbd.aspx C# Programming Guide]. 180 191 181 == 7. Frequent Mistakes ==182 183 * Use `Environment.NewLine` instead of the string constant "\n".184 * Use `Path.Combine()` instead of string concatenation (with `\` or `/`) to combine directory and file names.185 * Throw and catch specific exceptions, don't catch generic exceptions ~~`try { ... } catch(Exception ex) {}`~~186 * Use a finally block to make sure that the state of the program is consistent even when Exceptions are thrown.187 * Set the mouse pointer back to normal in a finally {... } block.188 * Use `string.Empty` instead of the string constant `""`;189 * Use `string.IsEmptyOrNull(a)` instead of `if(a!=null && a!="")`190 * Check for `InvokeRequired` in methods that manipulate GUI elements in controls.191 * Instantiate all objects of classes implementing `IDisposable` with the `using(...) { ... }` statement to make sure the object is disposed correctly.192 * When possible use LINQ syntax instead of extension methods for LINQ expressions.192 == 7. Coding Recommendations == 193 194 * use `Environment.NewLine` instead of the string constant `"\n"` 195 * use `Path.Combine()` instead of string concatenation (with `\` or `/`) to combine directory and file names 196 * throw and catch specific exceptions, don't catch generic exceptions ~~`try { ... } catch(Exception ex) {}`~~ 197 * use a finally block to make sure that the state of the program is consistent even when Exceptions are thrown 198 * if the mouse pointer was changed, set the mouse pointer back to normal in a finally {... } block 199 * use `string.Empty` instead of the string constant `""` 200 * use `string.IsEmptyOrNull(a)` instead of `if(a!=null && a!="")` 201 * check for `InvokeRequired` in methods that manipulate GUI elements in controls 202 * instantiate all objects of classes implementing `IDisposable` with the `using(...) { ... }` statement to make sure the object is disposed correctly 203 * when possible use LINQ syntax instead of extension methods for LINQ expressions 193 204 194 205 == 8. Final Remarks ==