Skip to content

Commit 50481c1

Browse files
authored
call it public notification
1 parent fe79d6c commit 50481c1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

graph/patterns/enums.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ In OData, enums represent a subset of the nominal type they rely on, and are esp
2121

2222
#### Enum or Booleans
2323

24-
Enumerations are a good alternative to Booleans when one of the two values (`true`, `false`) conveys other possible values not yet conceived. Let's assume we have an `Error` type and a property to communicate how to display it:
24+
Enumerations are a good alternative to Booleans when one of the two values (`true`, `false`) conveys other possible values not yet conceived. Let's assume we have an `publicNotification` type and a property to communicate how to display it:
2525

2626
```xml
27-
<ComplexType Name="error">
27+
<ComplexType Name="publicNotification">
2828
<Property Name="title" Type="Edm.String" />
2929
<Property Name="message" Type="Edm.String" />
3030
<Property Name="displayAsTip" Type="Edm.Boolean" />
3131
</ComplexType>
3232
```
3333

34-
The `false` value here merely communicates that the error shall not be displayed as a tip. What if, in the future, the error could be displayed as a `tip` or `alert`, and then in a more distant future, a `dialog` option is viable?
34+
The `false` value here merely communicates that the notification shall not be displayed as a tip. What if, in the future, the notification could be displayed as a `tip` or `alert`, and then in a more distant future, a `dialog` option is viable?
3535

3636
With the current model, the only way is to add more boolean properties to convey the new information:
3737

3838
```diff
39-
<ComplexType Name="error">
39+
<ComplexType Name="publicNotification">
4040
<Property Name="title" Type="Edm.String" />
4141
<Property Name="message" Type="Edm.String" />
4242
<Property Name="displayAsTip" Type="Edm.Boolean" />
@@ -50,7 +50,7 @@ Additionally speaking, the workload will now also have to validate the data stru
5050
By using an evolvable enum, instead, all we need to do is to add new members:
5151

5252
```diff
53-
<ComplexType Name="error">
53+
<ComplexType Name="publicNotification">
5454
<Property Name="title" Type="Edm.String" />
5555
<Property Name="message" Type="Edm.String" />
5656
+ <Property Name="displayMethod" Type="microsoft.graph.displayMethod" />

0 commit comments

Comments
 (0)