With these frameworks, the code creating instances don't need hard-coded names of classes. It lets a framework to find the right subclass based on some parameters.
It's also important to mention that if you use a switch statement, such code can't be extended. But these frameworks do support extensibility, because you'll simply create a new and you don't have to change the method creating instances.
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.