Why should namespace types not depend on nested namespace types?

The instructions for naming .Net ( http://msdn.microsoft.com/en-us/library/893ke618 (v = vs .71) .aspx ) have the following statement:

"The nested namespace must be type dependent in the containing namespace. For example, the classes in System.Web.UI.Design depend on the classes in System.Web.UI. However, the classes in System. Web.UI are independent of the classes in System. Web.UI.Design. "

I would like to know: why?

+7
source share
2 answers

Because it makes sense when you think about it.

Let me explain with a small example:

A knife> , for example, you need a handle so that it is "Knife".

But the handle does not need the knife to be a handle, right?

using KitchenSet; using KitchenSet.Knives; // This is where your knives (what uses Blades) would live. using KitchenSet.Knives.Blades; // The actual blades. 
+6
source

This is a reasonable rule because the classes defined in the System.Web.UI.Design namespace are visible to classes defined in the System.Web.UI.Design namespace, but the classes defined in the System.Web.UI.Design namespace are not visible for classes defined in the System.Web.UI namespace. In the latter case, you must add the using statement (Import to VB.NET).

0
source

All Articles