Introduction
...
Code Block |
---|
public JobSupervisor(Provider<JobDAO> jobDaoProvider, Provider<Long> jobTimeoutProvider) { |
The Provider<X> interface provides a get() method returning X. This allows for lazy initialization and/or providing an unknown number of X'es.
Further reading:
- http://www.vogella.com/tutorials/DependencyInjection/article.html
- http://square.github.io/dagger/
- http://www.infoq.com/presentations/Dagger
...
Code Block |
---|
void Foo() { int i1=42; int i2=0; i2 = f(i1); int i3 = g(i2); } |
Miscellaneous
Public methods should always check that their arguments follow the JavaDoc restriction with respect to being null, empty, non-negative etc. The ArgumentNotValid class has a number of useful methods for this.
...