Dependency injection by class constructor