Skip to content

Commit 91b9f30

Browse files
authored
added type naming conventions
1 parent 8f58515 commit 91b9f30

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

graph/patterns/subsets.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,28 @@ 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, types 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.
53+
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>`.
58+
5359

5460
```xml
55-
<ComplexType Name="<base-type>" IsAbstract="true">
56-
<Property Name="<enum-name-for-type>" Type="graph.<enum-type>"/>
61+
<ComplexType Name="<type>Base" IsAbstract="true">
62+
<Property Name="<type>Kind" Type="graph.<type>Kind"/>
5763
</ComplexType>
5864

59-
<Enum Name="<enum-type>">
60-
<Member Name="<value>"/>
65+
<Enum Name="<type>Kind">
66+
<Member Name="<value1>"/>
6167
<Member Name="<value2>"/>
6268
<Member Name="unknownFutureValue"/>
6369
</Enum>
6470

65-
<ComplexType Name="<type-1>" BaseType="graph.<base-type>"/>
71+
<ComplexType Name="value1<type>" BaseType="graph.<type>Base"/>
6672

67-
<ComplexType Name="<type-2>" BaseType="graph.<base-time>">
73+
<ComplexType Name="value2<type>" BaseType="graph.<type>Base">
6874
<Property Name="<property-name>" Type="<property-type>"/>
6975
</ComplexType>
7076
```

0 commit comments

Comments
 (0)