Scala, Design Patterns, Programming, Factory Pattern.
path: String) extends Reader { override def open(): Unit = System.out.println(s"jsonReader opened json on path ${path}") } private case class parquetReader(var path: String) extends Reader { override def open(): Unit = System.out.println(s"parquetReader opened parquet on path ${path}") } An