A c++ example of dependency injection.