3 ms·
Nice, I don't do much Scala so I never thought about using traits for that! Is that a common pattern? It seems similar to traditional OO dependency injection,
by default-kramer 8y ago
Nice, I don't do much Scala so I never thought about using traits for that! Is that a common pattern?
It seems similar to traditional OO dependency injection, except without all the ceremony of adding a constructor parameter and corresponding class member to hold it.
- bunderbunder 8y agoI'm not entirely sure how common it is. It's a case of multiple implementation inheritance, so I could see a lot of people balking at it.