且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么命名空间类型不应该依赖嵌套的命名空间类型?

更新时间:2023-10-27 09:52:46

因为考虑到这一点很有意义.

Because it makes sense when you think about it.

让我用一个小例子来说明:

Let me explain with a small example:

例如,

一个刀片需要一个手柄才能成为 刀".

A knife-blade for example needs a handle for it to be a "knife".

但是手柄不是,需要用小刀作为手柄,对吗?

But a handle doesn't need a knife-blade to be a handle, correct?

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