Skip to content

vmencik/scala-di

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Examples of dependency injection in Scala

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published