Question: d) What is dependency inversion principle? What should you do to follow this principle? Look at the following code snippet and explain what is
d) What is dependency inversion principle? What should you do to follow this principle? Look at the following code snippet and explain what is wrong with it? public abstract class Account { boolean createReservation(String ISBN) { BookItem book = Catalog.findBookByISBN (ISBN); return Library.reserve (book); }
Step by Step Solution
There are 3 Steps involved in it
Answer To follow the Dependency Inversion Principle Abstraction Define interfaces or abstract classes to represent highlevel policies or contracts tha... View full answer
Get step-by-step solutions from verified subject matter experts
