I recently read about sharing code with .NET assemblies and came across a good suggestion from this post : "Reduce the number of your .NET assemblies to a strict minimum."
I could not agree more! And one of the reasons that I personally see most often is that people just want to isolate part of the code, so they make types / methods internal and put them in a separate project.
There are many other reasons (valid and not) for splitting code into multiple assemblies, but if you want to isolate components / APIs while still in the same library, how can you do this?
namespace MyAssembly.SomeApiInternals
{
internal class Foo
{
internal void Boo() { }
}
}
namespace MyAssembly.AnotherPart
{
public class Program
{
public void Test()
{
var foo = MyAssembly.SomeApiInternals.Foo();
foo.Boo();
}
}
}
/ / , ?
( , .)
!