Skip to content

Instantly share code, notes, and snippets.

@brendoncheung
Created August 13, 2019 18:18
Show Gist options
  • Save brendoncheung/3d512cc2733f0b0c1348fc6b938ab92a to your computer and use it in GitHub Desktop.
Save brendoncheung/3d512cc2733f0b0c1348fc6b938ab92a to your computer and use it in GitHub Desktop.
class Client {
private ServiceA a;
private ServiceB b;
// Property injection
public ServiceC c;
// Constructor injection
public Client(ServiceA a, ServiceB b) {
this.a = a;
this.b = b;
}
// Method injection
public setServiceC(ServiceC c) {
this.c = c;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment