Ali Essa
Ali Essa

Reputation: 29

Parent - CHild management in C#

I have a question regarding C# inheritance management.

Should I write both classes (base and derived) under one namespace or should they be in different namespaces?

Upvotes: 1

Views: 102

Answers (2)

Tigran
Tigran

Reputation: 62248

Namespace is nothing else then a part of a complete name of your type.

So to choose either put them into the same namepsace or not, is not something that anyone could possibly know here. Choose them according the your code architecture.

Immagine being other developer and look on your types. Is it intuitive that both of them into the same namespace, or not ?

Hope this helps.

Upvotes: 3

CyberDude
CyberDude

Reputation: 8949

They don't need to be in the same namespace. You might even put them in different assemblies if the project architecture is like that.

Upvotes: 1

Related Questions