Project

General

Profile

Coding Guideline » History » Version 6

Carsten Rose, 06.11.2022 10:36

1 1 Carsten Rose
h1. Coding Guideline
2
3
4 6 Carsten Rose
h2. QFQ General
5 1 Carsten Rose
6 6 Carsten Rose
* http://docs.qfq.io/en/master/CodingGuideline.html
7
8
h2. I-MATH
9
10 1 Carsten Rose
  * Tabelle: 
11
12 5 Carsten Rose
    * *Name*: Camel case, erster Buchstabe *gross*, kein Underscore. Bsp: @FormElement@
13 4 Carsten Rose
    * Im ERD sollte bei jeder Tabelle auch die zu verwendende Abkürzung genannt werden. Bsp: @FormElement - fe@
14 1 Carsten Rose
    * Sind in
15
16
  * Spalten:
17
18 5 Carsten Rose
    * *Name*: Camel case, erster Buchstabe *klein*, kein Underscore. Bsp: @formId@
19 1 Carsten Rose
    * *Erste Spalte*: @id@, Primary Key.
20
    * *Vorletzte Spalte*: @created@, datetime, default: current timestamp
21
    * *Letzte Spalte*: @modified@, datetime, default: current timestamp, on update current timestamp
22
    * Wird auf einen Primary Key einer anderen Tabelle verwiesen, ergibt sich der Name aus <Kuerzel><Id>. Bsp: @pId@. 
23
24
      * Gibt es in einer Tabelle a) mehrere Spalten auf die gleiche Fremdtabelle (und muessen daher unterschiedlich sein) oder b) soll der Spaltenamen klarer beschreiben, kann eine Spezifizierung angehängt werden. Bsp: @pIdApplicant@, @pIdHead@. _Auf jeden Fall steht das @pId@ am Anfang_ .
25
26
  * Formular
27
28 5 Carsten Rose
    * *Name*: Camel case, erster Buchstabe *klein*, kein Underscore. Bsp: @formElement@
29
    * Sind in einer Instanz mehrere Tools, sollten die Forms anhand eines Prefixes unterschieden werden. Bsp: @dissReview@, @maReview@.
30 1 Carsten Rose
31
  * Spalte 'reference'
32
33 2 Carsten Rose
    * *Name*: Als Vorbereitung um unterschiedliche Tools aus verschiedenen Instanzen mergen zu koennen, wird empfohlen die Referenz Records mit einem  eindeutigen Prefix zu versehen. Bsp: @my_exercise_group@
34 3 Carsten Rose
35
  * BPMN
36
37
    * Zeichnung via DrawIO
38
39
  * ERD
40 1 Carsten Rose
41
    * Zeichnung via DrawIO
42 6 Carsten Rose
43
 * Constants
44
45
   * Define constants in @Extensions > QFQ > Custom > ...@
46
   * Dynamic values under @Extensions > QFQ > Dynamic > ...@
47
48
 * QFQ content record
49
50
   * Name the record in the header field with:
51
52
     * Regular content: [QFQ] ...
53
     * Content in the left column: [QFQ,L] ...
54
     * Content in englisch: [QFQ,E] ...
55
56
   * The first lines should be comments, explaining what the record does and list all passed variables. Optional variables are indicated by using STORE_EMPTY or STORE_ZERO: <pre>
57
#
58
# Shows list of Persons living in {{country:SE}}
59
#
60
# {{country:SE}}
61
#
62
</pre>
63
64
   * A good practice is to define all possible STORE_SIP Parameter in a SQL at the beginning and copy them to STORE_RECORD: <pre>
65
66
10 {
67
  # Normalize variables
68
  sql = SELECT '{{country:SE}}' AS _country
69
70
  # List selected persons per country
71
  20.sql = SELECT p.name FROM Person AS p WHERE p.country LIKE '{{country:R}}'
72
}
73
</pre>
74
75
   * Always comment the queries like shown above.
76
77
 * QFQ Form
78
79
   * Mandatory SIP parameter should to be mentioned in Form.requiredNew and/or Form.requiredEdit.
80
   * If the title of a FormElement isn’t descriptive enough, use tooltip, note or extraButtonInfo to explain to a user.
81
   * Every Form should show a descriptive title to identify the task and current record. E.g. Not ‘Person’ but ‘Person: John Doe’.
82
   * Often the length of a pill title if not sufficient, use a tooltip to give a more descriptive hint.