Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Examples of dependency injection in Scala
Scala Java
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
cake
scala-cdi
scala-guice
scala-spring-functional
scala-spring
subcut
.gitignore
README.md

README.md

Examples of dependency injection in Scala

All of the example projects are build using SBT.

cake

An example of the Cake Pattern.

scala-cdi

This project shows the use of Contexts and Dependency Injection in Scala. It is not set up to be run directly from SBT and needs to be deployed to a Java EE 6 compliant container like JBoss 7 or a servlet container with CDI implementation like Tomcat + Weld.

After deploying you can see it in action by accessing the CoffeeServlet at http://host:port/scala-cdi/coffee.

scala-guice

This project shows the use of Google Guice in Scala. Both in its pure form and with a thin Scala wrapper.

The functionality is demonstrated in the test suite ExampleSuite that you can run by invoking sbt test.

scala-spring

This project shows the use of the Spring Framework in Scala.

The it is quite similar to the scala-cdi project but it can be run directly from SBT using the Jetty plugin by running sbt console and invoking container:start. The CoffeeServlet then can be accessed at localhost:8080/coffee. You stop the embedded Jetty container by invoking container:stop.

scala-spring-functional

This (perhaps poorly named) project shows the use of Spring Scala.

It is almost exactly the same as scala-spring but it uses the functional configuration from the Spring Scala project.

It can be run directly from SBT using the Jetty plugin by running sbt console and invoking container:start. The CoffeeServlet then can be accessed at localhost:8080/coffee. You stop the embedded Jetty container by invoking container:stop.

subcut

This project demonstrates the use of SubCut.

You can run it by invoking sbt run.

Something went wrong with that request. Please try again.