This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package necsala.embedded | |
import scala.tools.nsc.interpreter.AbstractFileClassLoader | |
import scala.tools.nsc.{Global, Settings} | |
import scala.tools.nsc.util.BatchSourceFile | |
import scala.tools.nsc.io.{AbstractFile, VirtualDirectory} | |
import java.io.File | |
import java.util.jar.JarFile | |
import java.net.URLClassLoader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//harry huang [[email protected]] | |
// | |
//After reading the original post [http://jboner.github.com/2008/10/06/real-world-scala-dependency-injection-di.html, ] | |
//the original cake pattern seems quite verbose for me, and it is quite invasive, so I spent a bit time | |
//and come up with an improved version of cake pattern, which I call it a "Auto Cake DI". It is working | |
//well with any POST(plain old scala trait)/POSO(plain old scala object) which means that anything can be | |
//injected without modification or introducing new traits. | |
/*---------inject trait---------*/ | |
trait Inject[+T] { def inject: T } |