Naming Namespaces
Posted: Thu Oct 06, 2016 7:57 am
This message is inspired by the global:: example Robert showed in his beta 7a announcement.
It adresses the confusion/trouble we get if our namespaces conflict with namespaces introdused by other people. In case of the System namespace it may be a fault by ourself. But where should we place classes, that indeed belong to our own 'System'? The answer is clear:
Put your name/your company name in front of your own namespace!
All my namespaces begin with (obvious) 'FrankMaraite.'. I have, for example
FrankMaraite.CadBase
FrankMaraite.ViewModels
or, to match the example
FrankMaraite.System
or
FrankMaraite.MyApp1.System
Doing this is much clearer to read then using global::System or something like this.
Frank
It adresses the confusion/trouble we get if our namespaces conflict with namespaces introdused by other people. In case of the System namespace it may be a fault by ourself. But where should we place classes, that indeed belong to our own 'System'? The answer is clear:
Put your name/your company name in front of your own namespace!
All my namespaces begin with (obvious) 'FrankMaraite.'. I have, for example
FrankMaraite.CadBase
FrankMaraite.ViewModels
or, to match the example
FrankMaraite.System
or
FrankMaraite.MyApp1.System
Doing this is much clearer to read then using global::System or something like this.
Frank