Skip to content

Commit fddd8e1

Browse files
author
David Kline (ANALOG)
committed
update namespace rules to match #3546
1 parent 630ef7e commit fddd8e1

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

CodingGuidelines.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,31 @@ This ensures documentation is properly generated and disseminated for all all cl
3838
3939
## MRTK namespace rules
4040

41-
The vNext structure adheres to a strict namespace culture of mapping the namespace 1-1 with the folder structure of the project. This ensures that classes are easy to discover and maintain. It also ensures the dependencies of any class are laid out in the beginning using definitions of the file.
41+
The Mixed Reality Toolkit uses a feature based namespace model, where all foundational namespaces begin with "Microsoft.MixedReality.Toolkit". In general, you need not specify the toolkit layer (ex: Core, Providers, Services) in your namespaces.
4242

43-
![](External/ReadMeImages/MRTK-NameSpaceExample.png)
43+
The currently defined namespaces are:
44+
45+
- Microsoft.MixedReality.Toolkit
46+
- Microsoft.MixedReality.Toolkit.Boundary
47+
- Microsoft.MixedReality.Toolkit.Diagnostics
48+
- Microsoft.MixedReality.Toolkit.Editor
49+
- Microsoft.MixedReality.Toolkit.Input
50+
- Microsoft.MixedReality.Toolkit.SpatialAwareness
51+
- Microsoft.MixedReality.Toolkit.Teleport
52+
- Microsoft.MixedReality.Toolkit.Utilities
53+
54+
For namespaces with a large amount of types, it is acceptable to create a limited number of sub-namespaces to aid in scoping usage.
4455

4556
### Do:
4657

4758
```c#
48-
// Copyright (c) Microsoft Corporation. All rights reserved.
49-
// Licensed under the MIT License. See LICENSE in the project root for license information.
50-
51-
namespace Microsoft.MixedReality.Toolkit.Core.Definitions
59+
namespace Microsoft.MixedReality.Toolkit.Boundary
5260
{
53-
/// <summary>
54-
/// The ButtonAction defines the set of actions exposed by a controller.
55-
/// Denoting the available buttons / interactions that a controller supports.
56-
/// </summary>
57-
public enum ButtonAction
58-
{
59-
}
61+
// Interface, class or data type definition.
6062
}
6163
```
6264

63-
Absolutely no class / struct / enum or other definition should be entered in to the project without the appropriate namespace definition.
65+
Omitting the namespace for an interface, class or data type will cause your change to be blocked.
6466

6567
## Spaces vs Tabs
6668
Please be sure to use 4 spaces instead of tabs when contributing to this project.

0 commit comments

Comments
 (0)