Scala, Design Patterns, Programming, Factory Pattern.
abstract class was used for Reader although a trait could also be used to implement it. In cases when the piece of code must be reused in multiple or unrelated classes or complex class hierarchies, traits are more useful. Since this is a simple class hierarchy where the implementations naturally