Skip to content
Stéphane Nicolas edited this page May 7, 2016 · 32 revisions

Welcome to the Toothpick wiki!

Toothpick, alias TP, in a one sentence :

TP is a tree scope 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.

Please browse the main pages of the wiki via the sidebar on the right side of this page. ---->

A few rules to keep it mind :

  • Injections and instance creations take place within scopes
  • 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 depedencies 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