It has already been decided that the API routes use kebab case. In order to further standardize the communication between the services, it is also necessary to specify in which style the variables within the objects used for communication are named.
- snake_case
- camelCase
- kebab-case
- YELLING_SNAKE-KEBAB_CASE
The main reason to use kebab case is that it improves readability for SEO relevant systems. Also, it is a widely used standard, especially at the end of the URL (Designing Web APIs by Brenda Jin, Saurabh Sahni, Amir Shevat)[https://www.oreilly.com/library/view/designing-web-apis/9781492026914/]. However, it is not considered for the names of keys within an object in this system. This decision is based on the fact that none of the used development languages use this style for naming variables. It has already been decided that the API routes use kebap case. In order to further standardize the communication between the services, it is also necessary to specify in which style the variables within the objects used for communication are named.
It has not yet been determined how the services communicate with each other. A standard such as (cloudevents)[https://github.com/cloudevents/spec] has already been proposed for the events. The responses and requests via the REST interfaces have so far been formulated by all teams in a JSON-like format. Therefore, this decision is based on the assumption that communication will be done using JSON.
By researching online for known standards and looking at large established projects.
camelCase
Finding the right naming style depends heavily on the technology stack used. Since the technologies used in this project mainly use the camelCase internally, this was also chosen as the standard.
Language | Convention | Reference |
---|---|---|
Java | camelCase | https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html |
Kotlin | camelCase | https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/json.md |
Ruby | camelCase or snake_case | https://github.com/rubocop/ruby-style-guide |