Factory classes provide flexibility in terms of design. Below are some of the benefits of factory class:
•Factory design pattern results in more decoupled code as it allows us to hide creational logic from dependant code
•It allows us to introduce an Inversion of Control container
•It gives you a lot more flexibility when it comes time to change the application as our creational logic is hidden from dependant code