Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Toothpick (alias TP) in a one sentence :
TP is a scope tree based Dependency Injection (DI) library.
TP in a nutshell :
- Injections and instance creations take place within scopes.
- If ToothPick creates an instance, it will always inject its dependencies.
- TP always bubbles up the tree of scopes, never down.
- A scope contains bindings and scoped instances.
- Children scopes inherit bindings, they can override them.
- Children scopes can access their parents scoped instances.
- Bindings can be either scoped or unscoped.
- Scoped binding dependencies are either unscoped or scoped in the scope itself or its parents. <--this one is tough
- A scope can be bound to a scope annotation.
- Using a scope annotation is the same as scoping a binding.
Please browse the main pages of the wiki via the sidebar of this page. ---->
//a typical Toothpick scope tree during the execution of an Android app. @ApplicationSingleton / | \ / | \ / | \ @PresenterSingleton | Service 2 / | / Service 1 / Activity 1 / \ / Fragment 2 / Fragment 1
One of the goals of the Toothpick development team is to document Toothpick properly. This wiki is part of our effort as well as the code comments and javadoc.