R
Robert Cramer
Is it perfectly acceptable, from a "conventions" or "best practices" point
of view to have a class in one namespace extend a class in another
namespace?
I just came across this state of affairs in the .NET Framework itself and,
at first, it seemed somehow like a "bad thing" (in part because namespaces
are intended to group classes that serve some common purpose) - but after
about two seconds of thinking about it, I'm thinking that there is
absolutely nothing wrong with doing this - and in many situations, like in
large frameworks, it would even be unavoidable.
And example from the .NET Frameowork is:
System.ComponentModel.ComponentResourceManager
which extends
System.Resources.ResourceManager
Thoughts? Opinions? - specifically regarding the idea that it is (or is not)
perfectly acceptable to have a base class in one namespace, and then extend
that class in an entirely different namespace?
FWIW, I do understand that the classes, themselves, don't care about the
namespace in which they exist - at least not beyond qualifying references to
specific external classes.
Thanks.
of view to have a class in one namespace extend a class in another
namespace?
I just came across this state of affairs in the .NET Framework itself and,
at first, it seemed somehow like a "bad thing" (in part because namespaces
are intended to group classes that serve some common purpose) - but after
about two seconds of thinking about it, I'm thinking that there is
absolutely nothing wrong with doing this - and in many situations, like in
large frameworks, it would even be unavoidable.
And example from the .NET Frameowork is:
System.ComponentModel.ComponentResourceManager
which extends
System.Resources.ResourceManager
Thoughts? Opinions? - specifically regarding the idea that it is (or is not)
perfectly acceptable to have a base class in one namespace, and then extend
that class in an entirely different namespace?
FWIW, I do understand that the classes, themselves, don't care about the
namespace in which they exist - at least not beyond qualifying references to
specific external classes.
Thanks.