Suppose I create a new library Jokes,with a small API. In the interest of simplifying the use of my API, I put it in the base namespace:
namespace Jokes
--> public interface IJoker
--> string Joke();
--> public static class Jokers
--> public static IJoker NewSlapstickJoker()
--> public static IJoker NewAbsurdJoker()
--> public static IJoker NewCheesyJoker()
Joker implementations are internal:
--> internal class SlapstickJoker : IJoker
--> internal class AbsurdJoker : IJoker
--> internal class CheesyJoker : IJoker
Now I am sure that the following guide will follow (can someone please confirm?):
- You cannot use types from namespaces in the root namespace. (For example, types in
Systemdo not know types in System.Drawing).
Is this rule used for inner classes? To avoid contaminating my root namespace, I would like to put my inner classes in Jokes.Internal. This would mean that the type in the namespace Jokes( Jokers) would know about the types in the subzone Jokes.Internal. This is normal?