Scala, Design Patterns, Programming, Factory Pattern.
ProductFactory is used as an object instead of a class due to the fact that there is only gonna be one instance for it, as this instance doesn’t need parameters and doesn’t have any attributes. Code it’s more extensible as it can be extended the Product class or trait with a new implementation of