Attribute
About
attributes are metadata key pair values that are used:
- to configure the behavior of tabulify (known as parameter)
- or as template variable
Type
There is 3 kinds of attributes:
- parameters: fixed value that you can set
- literal: literal value retrieved from a system (Example: creation date, …)
- computed: value derived through computation (Example: count, digest, …)
Value
The value of an attribute may be:
- or a literal (ie not derived, the raw value)
Key Casing
Case Input: Independent sensitivity
Attribute names are case independent meaning that all these names are equivalent
- UserCount / userCount - Camel Case
- user_count / USER_COUNT - Snake Case
- user-count / USER-COUNT - Kebab/Hyphen Case
But the following are not:
- dataset and dataSet
- uSerCount and userCount
Why ? We parse the attribute name into words using as separators:
- uppercase
- spaces,
- underscores
- and any non alphanumeric character
Therefore:
- dataset is 1 word: dataset
- dataSet'is 2 words: data and set
- userCount is 2 words: user and count
- uSerCount is 3 words: u, ser and count
Casing output
Casing is a matter of:
- visual taste
- convention
- specification and target system (ie SQL does not allow a - minus in a name if not quoted)
We try to follow the following conventions when printing or serializing:
- Print Value: UPPER_SNAKE_CASE (mostly to show that they can be set via os environment variable
-
- lowercase is the standard state on a keyboard (one key press won, is one key press less)
- and we don't like shouting
- Yaml file: kebab-case (ie hyphen)