You should provide Benz instance in order for CarUtil’s drive() method to function. Before refactoring, ProductCatalog was dependent on SQLProductRepository.
Table of contents
Dependency Inversion Principle: How Google Developers write codeWhat is Dependency Inversion Principle?Can you see what’s wrong with this code?What is Abstraction?Refactoring Previous Code with AbstractionWhat you have achieved nowOne strep forward, Dependency InjectionConclusionOther Articles for Solid Principles2 Comments
Sort: