Implementing Common Design Patterns in Scala