Learning Dependency Inversion and Factory Method