x

Main chapters

  1. LimeSurvey Cloud vs LimeSurvey CE
  2. LimeSurvey Cloud - Quick start guide
  3. LimeSurvey CE - Installation
  4. How to design a good survey (Guide)
  5. Getting started
  6. LimeSurvey configuration
  7. Introduction - Surveys
  8. View survey settings
  9. View survey menu
  10. View survey structure
  11. Introduction - Questions
  12. Introduction - Question Groups
  13. Introduction - Surveys - Management
  14. Survey toolbar options
  15. Multilingual survey
  16. Quick start guide - ExpressionScript
  17. Advanced features
  18. General FAQ
  19. Troubleshooting
  20. Workarounds
  21. License
  22. Version change log
  23. Plugins - Advanced
 Actions

Naming conventions: Difference between revisions

From LimeSurvey Manual

Sammousa (talk | contribs)
No edit summary
(No difference)

Revision as of 23:10, 18 January 2013

Having moved to a (partial) MVC architecture we should adopt some conventions for naming our models and controllers.

The folks at cakephp (http://book.cakephp.org/2.0/en/getting-started/cakephp-conventions.html#model-and-database-conventions) came up with some nice naming conventions.

I suggest we use these for new concepts we introduce to our architecture.

In short:

- Models are singular: Plugin not Plugins.

- Database tables backing the model are plural, lowercase: plugins, not plugin or Plugins.

- Controllers are plural if they are "directly" backed by a model: PluginsController, not PluginController.

- Controllers are singular if they are not backed by a model: AdministrationController (which we shortened to AdminController)

- Controllers backed by a main model handle most stuff related to that model. This modularization makes it easy to find the code we are interested in when bugs need fixing.

I realize that functionally naming conventions don't have any benefit, however they do increase maintainability. Currently we don't have naming conventions (or I am unaware of them AND they have not been consistently obeyed in the current code base).