-
Notifications
You must be signed in to change notification settings - Fork 114
Home
Stéphane Nicolas edited this page May 8, 2016
·
32 revisions
Toothpick (alias TP) in a one sentence :
TP is a scope tree based Dependency Injection (DI) library.
//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.
Please browse the main pages of the wiki via the sidebar on the right side of this page. ---->
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 or its parents.
- A scope can be bound to a scope annotation.
- Using a scope annotation is the same as scoping a binding.