The next pattern applied by the team is the GoF factory pattern. The pattern introduces a creator whose responsibility is the instantiation of implementations of a specific type. Its purpose is to encapsulate the complexity around constructing types. The factory pattern allows for more flexibility as the application changes, by limiting the amount of required change compared to whether the construction was in the calling class. This is because the complexity of the construction is in one location, instead of distributed in multiple locations across the application.
In the FlixOne example, InventoryCommandFactory implements the pattern and shields the details of constructing each of the different InventoryCommand instances. In this scenario, the input received from the console application will be used to determine the concrete implementation of InventoryCommand...