Typesafe Activator

No-framework Dependency Injection with MacWire and Play Activator

No-framework Dependency Injection with MacWire and Play Activator

Source
adamw
October 18, 2013
basics
play
scala
dependency-injection
injection
macros

This activator explains what Dependency Injection is and shows how to do DI in a Play application, with the help from a small library, MacWire. But without any additional frameworks! You will see how to divide the wiring of your classes into modules using traits, as well as how to use Scala Macros to remove some boilerplate code.


Already have Typesafe Activator? Search for macwire-activator in the new application template catalog and create a new app.

Or grab the Activator Template Bundle:

  1. Download the Template Bundle
  2. Extract the downloaded zip file to your system
  3. Start Typesafe Activator's UI:

    In your File Explorer, navigate into the directory that the template was extracted to, right-click on the file named "activator.bat", then select "Open", and if prompted with a warning, click to continue:

    Or from a command line:

     C:\Users\typesafe\macwire-activator> activator ui 
    This will start Typesafe Activator and open this template in your browser.
comments powered by Disqus