I started using Ninject for my project, to automatically bind all subclasses of an abstract class. The binding for this is -- nice and easy -- as follows:
kernel
Put a .IncludingNonPublicTypes()
before the .SelectAllClasses()
and your bindings will also work for internal classes.
Also see this question: Cannot get Ninject.Extensions.Conventions to work
I don't think it's about security. I guess it's about design and maybe about performance: choosing from only the public types takes less time than choosing from all types.