0

I have a solution with multiple projects, lets suppose there's one project with the name Company.Name.Foo.Bar.

If I declare a class inside the project Company.Name.Foo.Bar but with a namespace Company.Name.BlaBla, would that be a bad practice?

The reason why I want to declare a class with a namespace that goes outside of it's project is to avoid/minimize naming conflict problems, like adding a bunch of alias or changing the name of a class to something different that it really means.

4
  • 1
    What kind of a conflict would you be having by using the actual project space in the namespace? Do you have other projects using the same namespace? Because that would be the issue, rather than you staying within your current project's namespace.
    – Flater
    Jan 19 at 19:46
  • @Flater I have a class that have the same name as the end of a namespace. e.g. class Foo and the namespace is Company.Project.Name.Foo
    – Vencovsky
    Jan 27 at 11:16
  • This seems to be an XY problem. You're now talking about an issue that is completely unmentioned in your question, and you're only focusing on the solution that you've managed to come up with rather than see if other and better solutions exist. I have voted to close this question but I will support reopening it when it's no longer an XY problem.
    – Flater
    Jan 27 at 11:33
  • @Flater I understand your point, you are correct. But if I explain my problem, it will be a question for Stack Overflow, not this stack
    – Vencovsky
    Jan 27 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.