Dependency injection libraries and Scala

Many developers with a background in Java might be already familiar with some of the famous dependency injection libraries. Some popular examples are Spring (https://spring.io/) and Guice (https://github.com/google/guice). In Spring, dependencies are usually managed in an XML file, where they are described, and the file tells the framework how to create instances and where to inject the objects into classes. Some of the terms used are beans.

On the other hand, Guice uses annotations that are then evaluated and replaced with the right objects. These are quite popular frameworks and they can also be used in Scala pretty easily. Those of you familiar with Play Framework will know that it uses exactly ...

Get Scala Design Patterns - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.