Skip to content
Zach Collins edited this page Jul 14, 2015 · 6 revisions

Using pitcher involves the following work flow

  1. writing Modules, analogous to the amd or commonjs concepts by the same name. Modules declare the classes or functions that should be used to create your object graph's singletons. They can also include, or override each other to compose or mock your various environments.

  2. declaring providers inside of your Modules. Providers simply describe the "global" singletons and services that Modules can construct, using a simple naming convention.

  3. executing the code generator to produce new code capable of instantiating all of your singletons and provide them their dependencies.

  4. instantiating your object graph from your generated code and retrieving all of your app's singletons.

Further details on the concepts can be found on the Dependency Injection Wikipedia article.

Clone this wiki locally