The basic premise is not to rely on specific classes (for example, you talked about new classes) and implement implementations (via interfaces). It depends on the specific task that you perform and under what conditions (Windows service, WCF service, Asp.Net), but in most cases you have an interface with all the methods that you want to publish publicly, for example
public interface IBar { void DoStuff(); }
Then you bind them to a specific class using Ninject i.e.
Bind<IBar>().To<BarClass>();
So, when you start Ninject jumps and gets a customized implementation. Plus, your configuration is configured, so itโs very easy to switch to another implementation while it implements the interface. Therefore, if you had a different class that you wanted to use instead of BarClass, you could just reinstall it. Ie
Bind<IBar>().To<NewBarClass>();
Therefore, when you need to use this NewBarClass, you must pass it this way
public class UserOfNewBarClass { public UserOfNewBarClass(IBar newBarClass) { }
In addition, you can mock interfaces when testing, which means that you can isolate individual concrete classes and test them in complete isolation. You can do more complex things that you can learn later, like a binding based on property values โโand a conditional binding to what you enter.
For entry points, refer to these
WCF - http://www.aaronstannard.com/post/2011/08/16/dependency-injection-ninject-wcf-service.aspx
MVC - http://www.shahnawazk.com/2010/12/dependency-injection-in-aspnet-mvc-3.html
Windows Service - Using Ninject with a Windows Service
Itโs hard to understand at first, but the Container (in this case Ninject) determines which implementation should be entered based on the binding you specified. The ultimate goal is to implement everything your class needs in order to execute its methods so that you can test it in isolation (this also helps to keep the class clean and uncluttered). The preferred way is to inject through the constructor, since the class will have all its dependencies when it is created. Entering properties is, of course, possible, but, as with properties, you cannot guarantee that it has been set.