Skip to content

Commit 4736c10

Browse files
committed
More updates from PR review
1 parent 99e26b2 commit 4736c10

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

azure/ConsiderationsForServiceDesign.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,60 +88,69 @@ As you build out your service and API, there are a number of decisions that can
8888

8989
Good names for resources, properties, operations, and parameters are essential to a good developer experience.
9090

91-
Resources are described by nouns. Resource and property names must be descriptive and easy for customers to understand. Ease of understanding comes from familiarity and recognition; you should favor consistency with other Azure services, names in the product's portal/user interface, and industry standards.
91+
Resources are described by nouns. Resource and property names must be descriptive and easy for customers to understand.
92+
Avoid names that refer to service implementation details, e.g. "TreeLeafNode", or simply describe the structure of value without
93+
describing its purpose, e.g. "KeyValuePair".
94+
Ease of understanding comes from familiarity and recognition; you should favor consistency with other Azure services, names in the product's portal/user interface, and industry standards.
9295

9396
Names should aid developers in discovering functionality without having to constantly refer to documentation.
9497
Use common patterns and standard conventions to aid developers in correctly guessing common property names and meanings.
9598
Use verbose naming patterns and avoid abbreviations other than
9699
well-known acronyms in your service domain.
97100

101+
:heavy_check_mark: **DO** use the same name for the same concept and different names for different concepts wherever possible.
102+
98103
### Recommended Naming Conventions
99104

100105
The following are recommended naming conventions for Azure services:
101106

102-
:heavy_check_mark: **DO** use singular nouns for resource (schema) names.
107+
:heavy_check_mark: **DO** name collections as plural nouns or plural noun phrases using correct English.
108+
109+
:heavy_check_mark: **DO** name values that are not collections as singular nouns or singular noun phrases.
103110

104-
:heavy_check_mark: **DO** use plural nouns for collections (for listing type or collection properties).
111+
:ballot_box_with_check: **YOU SHOULD** should place the adjective before the noun in names that contain both a noun and an adjective.
105112

106-
:ballot_box_with_check: **YOU SHOULD** case all acronyms the same as a normal word.
113+
For example, `collectedItems` not `itemsCollected`
107114

108-
For example, `nextUrl` and not `nextURL`.
115+
:ballot_box_with_check: **YOU SHOULD** case all acronyms as though they were regular words (i.e. lower camelCase).
109116

110-
☑️ **YOU SHOULD** use "At" suffix in names of `date-time` values.
117+
For example, `nextUrl` not `nextURL`.
111118

112-
:ballot_box_with_check: **YOU SHOULD** use "is" prefix in names of `boolean` values.
119+
:ballot_box_with_check: **YOU SHOULD** use "DateTime" suffix in names of `date-time` values.
113120

114-
☑️ **YOU SHOULD** use a suffix of the unit of measurement for values with a clear unit of measurement (such as bytes, miles, and so on). Use a generally accepted abbreviation for the units (e.g. "Km" rather than "Kilometers") when appropriate.
121+
:ballot_box_with_check: **YOU SHOULD** use a suffix of the unit of measurement for values with a clear unit of measurement (such as bytes, miles, and so on). Use a generally accepted abbreviation for the units (e.g. "Km" rather than "Kilometers") when appropriate.
115122

116123
:ballot_box_with_check: **YOU SHOULD** use an int for time durations and include the time units in the name.
117124

118125
For example, `expirationDays` as `int` and not `expiration` as `date-time`.
119126

120-
:ballot_box_with_check: **YOU SHOULD** prefix property names for properties concerning a different resource, particular for resource identifiers.
121-
122127
:warning: **YOU SHOULD NOT** use brand names in resource or property names.
123128

124-
⚠️ **YOU SHOULD NOT** use acronyms or abbreviations unless they are broadly understood for example, "ID" or "URL", but not "Num" for "number".
129+
:warning: **YOU SHOULD NOT** use acronyms or abbreviations unless they are broadly understood for example, "ID" or "URL", but not "Num" for "number".
130+
131+
:warning: **YOU SHOULD NOT** use names that are reserved words in widely used programming languages.
132+
133+
:no_entry: **DO NOT** use "is" prefix in names of `boolean` values.
125134

126135
:no_entry: **DO NOT** use redundant words in names.
127136

128137
For example, `/phones/number` and not `phone/phoneNumber`.
129138

130-
:no_entry: **DO NOT** use a "request", "response", or "collection" suffix on resource names.
131-
132139
### Common names
133140

134141
The following are recommended names for properties that match the associated description:
135142

136143
| Name | Description |
137144
|------------- | --- |
138-
| createdAt | The date-time that the resource was created |
139-
| updatedAt | The date-time that the resource was last updated/modified |
145+
| createdDateTime | The date-time that the resource was created |
146+
| updatedDateTime | The date-time that the resource was last updated/modified |
140147
| kind | The discriminator value for a polymorphic resource |
141148

142149
### `name` vs `id`
143150

144-
The identifier of a resource should be suffixed with `Id`. This holds even in the case where the identifier is assigned by the user with a PUT/PATCH method.
151+
:heavy_check_mark: **DO** use "Id" suffix for the name of rhe identifier of a resource.
152+
153+
This holds even in the case where the identifier is assigned by the user with a PUT/PATCH method.
145154

146155
## Use Previews to Iterate
147156
Before releasing your API plan to invest significant design effort, get customer feedback, & iterate through multiple preview releases. This is especially important for V1 as it establishes the abstractions and patterns that developers will use to interact with your service.

0 commit comments

Comments
 (0)