Naming convention

Here you can find conventions about naming terms, fields, attributes, etc.

Arabic / Quranic terms

For naming Arabic / Quranic terms transliteration of singular form is used. A transliteration must not contain non-ASCII symbols (like ā) and apostrophe(like in Qur'an). A plural form must be formed from singular form + "s", instead of transliteration of the plural form in Arabic. For example, we use "surahs" (surah + s) instead of "suwar" (transliteration from Arabic for plural form). Here is a list of most common terms and their names in Digital Quran:

Naming

  • Identifiers use only ASCII letters and digits and the first symbol must be a letter.

  • lowerCamelCase is used for naming elements, objects, attributes, etc.

  • Names of logical (true/false) fields start with "is" prefix, like "isAlive".

  • Array fields, i.e. fields accepting many values are in plural form, like "authors". In JSON format, the value of such fields is an array (mostly array of objects). In XML format, such an element contains many elements with the same name, but in a singular form. Here is an example of an array field:

JSON
contacts: [
    {
        "type": "email",
        "value": "example.com"
    },
    {
        "type": "phone",
        "value": "+123456789"
    }
]
  • In XML files using an element is preferred over an attribute. Except for a few elements, there are no attributes in XML documents. Instead, nested elements are used.

Last updated