I have a configuration component in my Scala project.
Obviously I don't want to have more than one instance of this component. I'm using the cake pattern, but I'm not sure how to tweak it to fit my requirements:
// Library
//…
This question may help you understand my needs.
Cake pattern: one component per implementation, or one component per trait?
I have a Scala application using multiple UserService implementations which will be provided by component(s?).
I wonder if…
Using self-type for dependency injections, cause to expose public method of other traits ,which break the single responsibility principal. Let's me talk with example
trait Output {
def output(str: String): Unit
}
trait ConsoleOutput extends…
I've encountered a problem when self type alias name 'overrides' extended class field and compiler doesn't indicate it.
My scenario with akka actors:
class MyActor extends Actor { self: SomeModuleInjection =>
...
someActorRef ! SomeMessage
…
I'm trying to follow the example from this blog. I understand the example but having trouble implementing it.
trait Database {
// ...
}
trait UserDb {
this: Database =>
// ...
}
trait EmailService {
this: UserDb =>
// Can only access…
I have the following class hierarchy:
abstract class Event(val timeStamp:Long,val id:Long )
case class StudentEvent(override val timeStamp:Long, override val id:Long,
firstName:String,lastName:String) extends Event(timeStamp,id )
case…
I am trying to create an abstraction for a SearchService using the Cake pattern. This is what I have currently:
trait SearchServiceComponent{
val searchService:SearchService
trait SearchService{
def searchForSomething(..):List[String]
…
Parametrized components work well with the cake pattern as long as you are only interested in a unique component for each typed component's, example:
trait AComponent[T] {
val a:A[T]
class A[T](implicit mf:Manifest[T]) {
println(mf)
…
Problem: I have used the cake pattern to build a system of components (traits) which define a family of types and specialise them covariantly (cf., family polymorphism). Then I have defined a component which defines some actors and messages to be…
I am trying to implement a cake pattern like code, but I get:
Error:(47, 36) illegal inheritance;
self-type app.server.im.Im_Api_Service_Impl.type does not conform to app.server.im.Persistence[app.server.im.State.State]'s selftype…
I have seen a couple of posts related to DI using cake pattern.
One of them being http://jonasboner.com/real-world-scala-dependency-injection-di/ shared by one of my colleagues.
But If I need to use say WSClient from Play 2.5, can I get hold of…
I'm using Scala Slick-3.1.0 lib.
How is it possible to make a generic Slick filter function that takes TableQuery instance as an input and makes same slick filter on it?
I have several case classes (two for example) representing data stored in…
Before i try to make a manual graph of dependency (using inkscape) to resume all possibility for my scala program which use heavily cake pattern, i ask question here.
Is there a best and simple way to automaticaly cartography a complex hierarchy of…
I was trying to convert my understanding about cake patterns in to simple scala code and found out that its not compiling. Could some one please have a look at the below code and tell me whats the problem in the way I understand the patterns? I read…