July 2019
Intermediate to advanced
410 pages
10h 32m
English
The dependency inversion principle (DIP), also referred to as the dependency injection principle (DIP), modules should not depend on details but, instead, on abstractions. This principle encourages writing loosely coupled code to enhance both readability as well as maintenance, especially in a large complex code base.
If we revisit the ConsoleUserInterface class that was introduced earlier (in the Single responsibility principle section), we could use the class without the QuitCommand as follows:
internal class QuitCommand : InventoryCommand{ internal override bool InternalCommand() { var console = new ConsoleUserInterface(); console.WriteMessage("Thank you for using FlixOne Inventory Management System"); Read now
Unlock full access