Skip to content

Commit fbc7af5

Browse files
committed
Final edit pass
1 parent 91b9f30 commit fbc7af5

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

graph/patterns/subsets.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ Microsoft Graph API Design Pattern
66

77
## Problem
88

9-
A common pattern is to apply a policy or state to a collection of resources. With this, there also comes the question of how to model cases where we want to apply to 'all' or 'none' without having to special case these values within the collection set or introduce cross-property dependencies. Likewise, we'd like to model it in a way where it is easy to understand and interpret usage from just looking at the schema.
9+
A common pattern is to apply a policy or state to a collection of resources. With this, there also comes the question of how to model cases where we want to apply to `all` or `none` without having to special case these values within the collection set or introduce cross-property dependencies. Likewise, we'd like to model it in a way where it is easy to understand and interpret usage from just looking at the schema.
1010

1111
An example is where you have a policy that you need to be able to apply to users in an organization. You might want to support the default **None**, enablement for **All**, or enablement for **Select** users where you only grant it to a few users.
1212

13-
Existing patterns for this either have special-cased 'strings' or have tightly coupled dependencies between two independent properties. Neither is intuitive, both require reading documentation, and neither can be inferred from the schema or within client libraries.
13+
Existing patterns for this either have special-cased `strings` or have tightly coupled dependencies between two independent properties. Neither is intuitive, both require reading documentation, and neither can be inferred from the schema or within client libraries.
1414

1515
## Solution
1616

17-
Have an abstract base class where all 'variants' of the subset are derived types from the base subset. For more information, see the [general subtyping guidance](https://github.com/microsoft/api-guidelines/blob/graph/graph/patterns/subtypes.md).
17+
Have an abstract base class where all `variants` of the subset are derived types from the base subset. For more information, see the [general subtyping guidance](./subtypes.md).
1818

19-
The abstract base class should also hold an enum for all possible variants. The purpose of including this is to allow for easier ways to do query and filter operations on variants like 'all' and 'none' without relying on `isof` functions.
19+
The abstract base class should also hold an enum for all possible variants. The purpose of including this is to allow for easier ways to do query and filter operations on variants like `all` and `none` without relying on `isof` functions.
2020

2121
**Base type**
2222

@@ -49,13 +49,12 @@ The abstract base class should also hold an enum for all possible variants. The
4949
</ComplexType>
5050
```
5151

52-
Be aware that the name values and types in the preceding examples are just examples and can be replaced with your scenario equivalent values. For example, type names don't really need to be `memberships`.The collection doesn't have to be a collection at all; it can be singular and doesn't have to be a string.
52+
Be aware that the name values and types in the preceding examples are just examples and can be replaced with your scenario equivalent values. For example, type names don't really need to be `memberships`. The collection doesn't have to be a collection at all; it can be singular and doesn't have to be a string.
5353

54-
These pattern type names should satisfy the following naming conventions:
55-
56-
- The base type name should have the suffix "Base" and the enumeration type name should have the suffix "Kind".
57-
- Derived child types should have names with enumeration values as the prefixes; for example, if the enumeration member value is `value1`, then the derived type name is `value1<type>`.
54+
These pattern type names should satisfy the following naming conventions:
5855

56+
- The base type name should have the suffix `Base`, and the enumeration type name should have the suffix `Kind`.
57+
- Derived child types should have names with enumeration values as the prefixes; for example, if the enumeration member value is `value1`, then the derived type name is `value1<type>`.
5958

6059
```xml
6160
<ComplexType Name="<type>Base" IsAbstract="true">
@@ -88,7 +87,7 @@ If you only ever need to support two states&mdash;All or None&mdash;without usin
8887

8988
## Issues and considerations
9089

91-
Given that we are using an overarching subtype model, subtyping model limitations apply here as well; for more details, see the [subtyping documentation](https://github.com/microsoft/api-guidelines/blob/graph/graph/Modelling%20with%20Subtypes%20Pattern.md).
90+
Given that we are using an overarching subtype model, subtyping model limitations apply here as well; for more details, see the [subtyping documentation](./subtypes.md).
9291

9392
## Example
9493

0 commit comments

Comments
 (0)