Scala, Design Patterns, Programming, Factory Pattern.
options through the getOptions method. The different Reader implementations through open method print a string based on the kind of reader, their path attribute and the options parameter. As it can be observed the different kinds of classes are instantiated separately and not inside each other like