Questions tagged [subcut]

SubCut, or Scala Uniquely Bound Classes Under Traits, is a mix of service locator and dependency injection patterns designed to provide an idiomatic way of providing configured dependencies to scala applications.

SubCut, or Scala Uniquely Bound Classes Under Traits, is a mix of service locator and dependency injection patterns designed to provide an idiomatic way of providing configured dependencies to scala applications.

See https://github.com/dickwall/subcut

8 questions
19
votes
1 answer

Comparing Subcut and Scaldi

I am looking at SubCut and Scaldi to use in my projects. The examples provided in their respective Getting Started documents seem very similar. Neither project seems to provide documentation beyond Getting Started and scala docs. Could somebody…
Daniel Mahler
  • 7,653
  • 5
  • 51
  • 90
2
votes
0 answers

Can I modify subcut modules in spray route test?

I have a Specs2RouteTest "test a route with some modified dependencies" in { bindingModule.modifyBindings { implicit module => module.bind[AuthorizationService].toModuleSingle { createMockAuthService("1") } val req =…
danb
  • 10,239
  • 14
  • 60
  • 76
2
votes
1 answer

How to integrate subcut dependent modules?

Based on available documentation this task seems straightforward, however I've been hitting my head in the wall for a couple of days on this and still can't make it work for a simple inter-module dependency... Here's a reduced example: trait Bla { …
Pablo Lalloni
  • 2,615
  • 19
  • 20
1
vote
1 answer

SubCut BindingModule composition

With SubCut I can define a BindingModule and use modifyBindings to get a new one which can overwrite some bindings and also add new bindings. Is there a utility where instead of saying val module : BindingModule val newModule =…
Ustaman Sangat
  • 1,505
  • 1
  • 14
  • 26
1
vote
1 answer

Using Subcut to inject a string into a third party library

I am trying to integrate Subcut with my project for Dependency injection and am running into an issue integrating it with a third party library. The library requires the location of a file to load which I am storing in my Play configuration and I…
ahjmorton
  • 965
  • 1
  • 5
  • 18
1
vote
1 answer

Instantiating Akka actors in a Play application with Subcut

I have a Play 2.1 application. I am also using Subcut for dependency injection, which is already set up and working for most parts of the application, except for one. Say I have the following snippet of actor-related code: import…
kes
  • 5,983
  • 8
  • 41
  • 69
1
vote
1 answer

Cannot use modifyBindings in SubCut

Would modifyBindings worked as promised this test should pass: import org.scalatest.FunSuite import org.scala_tools.subcut.inject.NewBindingModule import org.scala_tools.subcut.inject.BindingModule import…
alehro
  • 2,198
  • 2
  • 25
  • 41
0
votes
1 answer

How to use controller route defined by subcut in the template

I have a route defined as @com.xyx.abc(str: String) in my routes file. I want to use this route in a template. I tried using Obviously didn't work. Thanks in advance.
Shashi
  • 91
  • 7