Scala, Design Patterns, Programming, Factory Pattern.
but the compiler won’t alert any error. These logic errors are a headache to debug and can arise easily as more factory methods are implemented and incompatibilities could be caused. Furthermore in case we want to provide a new specific method to one of the Reader implementations, it’s needed also