-
Notifications
You must be signed in to change notification settings - Fork 115
Home
Stéphane Nicolas edited this page Nov 24, 2019
·
32 revisions
If you were already using TP 2, please have a look at our Migration guide to start using TP 3.
TP is a scope tree based Dependency Injection (DI) library.
- What is a scope?
- Injections and instance creations take place within scopes.
- If ToothPick creates an instance, it will inject its dependencies.
- TP always bubbles up the tree of scopes, never down.
- A scope contains bindings and singletons.
- Children scopes inherit bindings, they can override them.
- Children scopes can access their parents' bindings & singletons.
- 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.
@ApplicationScope
/ | \
/ | \
/ | \
@ViewModelScope | Service 2
/ |
/ Service 1
/
@Activity1Scope
/
/
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.