DEV Community

Discussion on: Why Switch Statement is Bad

Collapse
 
mahmoudmohamedelgamily profile image
Mahmoud-Mohamed-Elgamily

what if we used switch statement inside factory pattern ?

Collapse
 
eslamelkholy profile image
eslamelkholy

very nice one we can use Factory Pattern and Refactor Switch Statement to be exactly the same as we did here