A transition from Java to Scala with highlighting Factory Pattern.