Attribute

Undraw My Documents

Attribute

About

attributes are metadata key pair values that are used:

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:

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
  • Print Header / Column Name: lower_snake_case because
    • 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)
Task Runner