public void SomeMethod() { //You don't care what type of class you get here //you only care that the object you get back let's you //call GetData. IFooBar foobar = DataManager.GetFooBar(); String data = foobar.GetData(); //etc }