Last active
May 16, 2016 23:24
-
-
Save dlemures/8d4ee4fa163a1a475802217a2c7a385a to your computer and use it in GitHub Desktop.
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
public class SmoothieShopModule extends Module { | |
public SmoothieShopModule() { | |
bind(Blender.class).to(JarBlender.class); // Blender -> JarBlender | |
bind(Freezer.class).to(new Freezer()); // Freezer -> Freezer instance | |
} | |
} | |
class SmoothieShop { | |
@Inject SmoothieMaker smoothieMaker1; | |
@Inject SmoothieMaker smoothieMaker2; | |
public SmoothieShop() { | |
Scope scope = Toothpick.openScope("SmoothieShop"); | |
scope.installModule(new SmoothieShopModule()); | |
Toothpick.inject(this, scope); | |
... | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment