If I define an interface ITestInterface and then immediately create a class that implements that interface for usage within an application is it ok to keep the class and interface in the same namespace or should they be seperate. i.e. Test.Interfaces and Test.Interfaces.Implementation.
Both my interface and its implementation will be in its own assembly so I’m not looking to create another one just to contain the interface itself.
This is particular related to c# however I guess it can cover any language.
It’s probably better to use the established conventions of the .NET predefined classes. For example, looking in the
System.Collections.Genericnamespace we can see that bothIDictionaryandDictionaryare there. So probably putting them in the same namespace is the best idea.Also, since both the interface and the implementation most likely serve the same purpose, it’s better to group them in the same namespace.