Class.Class vs Namespace.Class for top level general use class libraries?

后端 未结 7 1771
难免孤独
难免孤独 2020-12-11 07:52

Which one is more acceptable (best-practice)?:

namespace NP
   public static class IO
   public static class Xml
   ...
   // extension methods

using NP;

I         


        
7条回答
  •  隐瞒了意图╮
    2020-12-11 07:57

    I think you should avoid exposed (public) nested classes and interfaces, or at least that is what Microsoft FxCop would say. Thus, the first one is better.

    Edit: (yes, changed to the first one, i shouldn't reply in SO when i'm dead tired)

提交回复
热议问题