You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: azure/ConsiderationsForServiceDesign.md
+25-16Lines changed: 25 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,60 +88,69 @@ As you build out your service and API, there are a number of decisions that can
88
88
89
89
Good names for resources, properties, operations, and parameters are essential to a good developer experience.
90
90
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.
92
95
93
96
Names should aid developers in discovering functionality without having to constantly refer to documentation.
94
97
Use common patterns and standard conventions to aid developers in correctly guessing common property names and meanings.
95
98
Use verbose naming patterns and avoid abbreviations other than
96
99
well-known acronyms in your service domain.
97
100
101
+
:heavy_check_mark:**DO** use the same name for the same concept and different names for different concepts wherever possible.
102
+
98
103
### Recommended Naming Conventions
99
104
100
105
The following are recommended naming conventions for Azure services:
101
106
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.
103
110
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.
105
112
106
-
:ballot_box_with_check:**YOU SHOULD** case all acronyms the same as a normal word.
113
+
For example, `collectedItems` not `itemsCollected`
107
114
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).
109
116
110
-
☑️ **YOU SHOULD** use "At" suffix in names of `date-time` values.
117
+
For example, `nextUrl` not `nextURL`.
111
118
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.
113
120
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.
115
122
116
123
:ballot_box_with_check:**YOU SHOULD** use an int for time durations and include the time units in the name.
117
124
118
125
For example, `expirationDays` as `int` and not `expiration` as `date-time`.
119
126
120
-
:ballot_box_with_check:**YOU SHOULD** prefix property names for properties concerning a different resource, particular for resource identifiers.
121
-
122
127
:warning:**YOU SHOULD NOT** use brand names in resource or property names.
123
128
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.
125
134
126
135
:no_entry:**DO NOT** use redundant words in names.
127
136
128
137
For example, `/phones/number` and not `phone/phoneNumber`.
129
138
130
-
:no_entry:**DO NOT** use a "request", "response", or "collection" suffix on resource names.
131
-
132
139
### Common names
133
140
134
141
The following are recommended names for properties that match the associated description:
135
142
136
143
| Name | Description |
137
144
|------------- | --- |
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 |
140
147
| kind | The discriminator value for a polymorphic resource |
141
148
142
149
### `name` vs `id`
143
150
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.
145
154
146
155
## Use Previews to Iterate
147
156
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